How To Generate Password Hash And A Salt In Nodejs

[Solved] How To Generate Password Hash And A Salt In Nodejs | Perl - Code Explorer | yomemimo.com
Question : how to hash password in node js

Answered by : sudip-karmakar

npm i bcrypt
const bcrypt = require('bcrypt');
async function hashIt(password){ const salt = await bcrypt.genSalt(6); const hashed = await bcrypt.hash(password, salt);
}
hashIt(password);
// compare the password user entered with hashed pass.
async function compareIt(password){ const validPassword = await bcrypt.compare(password, hashedPassword);
}
compareIt(password);

Source : | Last Update : Fri, 09 Oct 20

Question : how to generate password hash and a salt in nodejs

Answered by : wild-weevil-c44w51tgwgz3

PASSWORD HASHING IN NODEJS

Source : | Last Update : Fri, 04 Mar 22

Answers related to how to generate password hash and a salt in nodejs

Code Explorer Popular Question For Perl