1const bcrypt = require('bcrypt');
2const saltRounds = 10;
3
4bcrypt.hash(myPlaintextPassword, saltRounds, function(err, hash) {
5 // Store hash in your password DB.
6});
7
8// Load hash from your password DB.
9bcrypt.compare(myPlaintextPassword, hash, function(err, result) {
10 // result == true
11});