1// app.js
2
3const bcrypt = require("bcrypt");
4const saltRounds = 10;
5const plainTextPassword1 = "DFGh5546*%^__90";
6
7bcrypt
8 .genSalt(saltRounds)
9 .then(salt => {
10 console.log(`Salt: ${salt}`);
11
12 return bcrypt.hash(plainTextPassword1, salt);
13 })
14 .then(hash => {
15 console.log(`Hash: ${hash}`);
16
17 // Store hash in your password DB.
18 })
19 .catch(err => console.error(err.message));
20
1// app.js
2
3const bcrypt = require("bcrypt");
4const saltRounds = 10;
5const plainTextPassword1 = "DFGh5546*%^__90";
6
7bcrypt
8 .hash(plainTextPassword1, saltRounds)
9 .then(hash => {
10 console.log(`Hash: ${hash}`);
11
12 // Store hash in your password DB.
13 })
14 .catch(err => console.error(err.message));
15