Last active
December 20, 2015 13:29
-
-
Save lusentis/6139172 to your computer and use it in GitHub Desktop.
Hashes an user-entered password.
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
/*jshint node:true */ | |
'use strict'; | |
var bcrypt = require('bcrypt') | |
, read = require('read'); | |
read({ prompt: 'Password (typing will be hidden): ', silent: true, replace: '*' }, function (err, pass) { | |
var hash = bcrypt.hashSync(pass, 12); | |
process.stdout.write(hash + '\n'); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment