Created
November 16, 2016 11:01
-
-
Save taylortom/48b24b7fc4576b9c97c7d8477d7636d5 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