Last active
August 29, 2015 14:16
-
-
Save gtomitsuka/fb878afd3c3932dd8248 to your computer and use it in GitHub Desktop.
Node.js SHA-256 Hashing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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