Created
October 20, 2015 16:28
-
-
Save dennis-learningpool/4a4a9c01017bc9640478 to your computer and use it in GitHub Desktop.
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
var bcrypt = require('bcrypt-nodejs'); | |
var usage = 'usage: node passwordgen.js <password>'; | |
if (process.argv.length != 3) { | |
console.log(usage); | |
process.exit(1); | |
} | |
var plaintext = process.argv[2]; | |
bcrypt.genSalt(10, function (err, salt) { | |
bcrypt.hash(plaintext, salt, null, function (err, hash) { | |
console.log(hash); | |
process.exit(0); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment