title: Converting some php encryption functions to nodejs(sha1)
body: <p>I have to convert this function from php to javascript:</p>
  <pre><code>&lt;?php
     
     $hashbytes = mb_convert_encoding($hashtr, &quot;ISO-8859-9&quot;);
     $hash = base64_encode ( sha1 ( $hashbytes, true ) );
  </code></pre>
  <p>And i tried this :</p>
  <pre><code>   function sha1(data) {
         return crypto.createHash(&quot;sha1&quot;).update(data, &quot;binary&quot;).digest(&quot;hex&quot;);
     }
  
     hash = Buffer.from( sha1 ( hashtr, true )).toString('base64')
     
  </code></pre>
  <p>But when i compare that results they are not equals. Where i do mistake ?</p>