Skip to content

Instantly share code, notes, and snippets.

@brickpop
Created November 16, 2016 19:17
Show Gist options
  • Save brickpop/563c615a9c52a7b98e1dc4ddf468cbce to your computer and use it in GitHub Desktop.
Save brickpop/563c615a9c52a7b98e1dc4ddf468cbce to your computer and use it in GitHub Desktop.
Password digest for NodeJS
var crypto = require('crypto');
function digestPwd(password){
var shasum = crypto.createHash('sha1');
shasum.update(password);
return shasum.digest('hex');
}
module.exports = digestPwd;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment