install bcrypt
>> npm install bcrypt const bcrypt = require('bcrypt');
install bcrypt
npm install bcryptjs
bcryptjs
npm i bcryptjs # yarn yarn add bcryptjs
bcrypt npm
npm install bcrypt
Source: www.npmjs.com
bcrypt npm
bcrypt.genSalt(saltRounds, function(err, salt) { bcrypt.hash(myPlaintextPassword, salt, function(err, hash) { // Store hash in your password DB. }); });
Source: www.npmjs.com
bcrypt npm
// Load hash from your password DB. bcrypt.compare(myPlaintextPassword, hash, function(err, result) { // result == true }); bcrypt.compare(someOtherPlaintextPassword, hash, function(err, result) { // result == false });
Source: www.npmjs.com