Skip to content

Instantly share code, notes, and snippets.

@gtomitsuka
Last active August 29, 2015 14:16
Show Gist options
  • Save gtomitsuka/fb878afd3c3932dd8248 to your computer and use it in GitHub Desktop.
Save gtomitsuka/fb878afd3c3932dd8248 to your computer and use it in GitHub Desktop.
Node.js SHA-256 Hashing
// Please make sure you have the crypto module installed
//Modules
var crypto = require('crypto');
module.exports = function(value) {
return crypto.createHash('sha256').update(pwd).digest('base64');
};
/* Call it like this:
var hash = require('./hash');
var hashedPassword = hash("password");
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment