title: Node Js SHA 1 multiple times
body: <p>Hello I have this Java code which uses the following encryption method to encrypt password.</p>
  
  <pre><code> MessageDigest digester = MessageDigest.getInstance("SHA-1");
   value = digester.digest(password.getBytes());
   digester.update(email.getBytes());
   value = digester.digest(value);
  </code></pre>
  
  <p>This returns base64 encoded string like <code>qXO4aUUUyiue6arrcLAio+TBNwQ=</code> This is sample not exact.</p>
  
  <p>I am converting this to NodeJs not sure how to handle this. I have tried like </p>
  
  <pre><code>var crypto = require('crypto');
  var shasum = crypto.createHash('sha1'); 
  var value = shasum.update('hello'); 
  shasum.update('abc@xyz.com'); 
  value = shasum.digest(value).toString('base64'); 
  console.log(value);
  </code></pre>
  
  <p>The string base64 I get in node js is not similar to get from java. Not sure why?. I need to have same encoding as java as its old system migrated to new one cant lose old details.</p>
  
  <p>Can someone help me how I can achieve same base64 string.</p>