There is also a version of bcrypt native-js that does not require compilation. https://github.com/shaneGirish/bcrypt-nodejs
npm install bcrypt-nodejs
Api is very similar to the compiled version. The following is taken directly from readme
Main use:
Synchronous
var hash = bcrypt.hashSync("bacon"); bcrypt.compareSync("bacon", hash); // true bcrypt.compareSync("veggies", hash); // false
Asynchronous
bcrypt.hash("bacon", null, null, function(err, hash) { // Store hash in your password DB. }); // Load hash from your password DB. bcrypt.compare("bacon", hash, function(err, res) { // res == true }); bcrypt.compare("veggies", hash, function(err, res) { // res = false });
Noah
source share