title: Hash string using SHA-1 and base64 encode
body: <p>How to hash a string using <code>SHA-1</code> and <code>base64</code> encode? I have package openssl and I can use <code>sha1</code> function to has a string but I don't know how to combine <code>sha-1</code> and <code>base64</code> encode to my string.</p>
  
  <p>For testing purpose, my string is:</p>
  
  <pre><code>HY8&amp;V5EDJO8NYT9C2011-12-13T00:44:02ZTest123
  </code></pre>
  
  <p>I need to SHA-1 and base64 encode to output:</p>
  
  <pre><code>nuoiyUX6m+irC5rvB4QUSycfHGc=
  </code></pre>
  
  <p>Please could someone kindly advice?</p>