Chapter 9: add hasing-with-bcrypt samples
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
const password = process.argv[2];
|
||||
const hash = process.argv[3];
|
||||
const bcrypt = require("bcrypt");
|
||||
|
||||
bcrypt
|
||||
.compare(password, hash)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
})
|
||||
.catch((err) => console.error(err.message));
|
||||
Reference in New Issue
Block a user