How to achieve "Base64 encoded SHA-1 hash of a string" in Nodejs.
Thanks.
Crypto can return base64 encoded results directly:
var crypto = require('crypto');
var s = 'the quick brown fox';
var sha = crypto.createHash('sha1');
sha.update(s);
var ret = sha.digest('base64');
console.log(ret);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With