Skip to content

Instantly share code, notes, and snippets.

@thinkphp
Created March 7, 2013 19:09
Show Gist options
  • Save thinkphp/5110833 to your computer and use it in GitHub Desktop.
Save thinkphp/5110833 to your computer and use it in GitHub Desktop.
Creating sha-1 on Node.js.
var crypto = require('crypto');
function sha1( data ) {
var generator = crypto.createHash('sha1');
generator.update( data )
return generator.digest('hex')
}
console.log( sha1('adrian') )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment