21 lines
499 B
JavaScript
21 lines
499 B
JavaScript
|
const bcrypt = require('bcrypt')
|
||
|
|
||
|
// const pass = async () => {
|
||
|
// // create a password
|
||
|
// const salt = await bcrypt.genSalt(12)
|
||
|
// const passwordHash = await bcrypt.hash('7901228899', salt)
|
||
|
// console.log(passwordHash)
|
||
|
// }
|
||
|
// pass()
|
||
|
|
||
|
const passDec = async () => {
|
||
|
const _pass = await bcrypt.compare(
|
||
|
'strongpassword',
|
||
|
'$2b$12$PZ8N1jU77nnNUCCGyKTMNOi2QI7X/SgPsISVQfr.cQ/jgdx5Z7AqC'
|
||
|
)
|
||
|
console.log('_pass: ', _pass)
|
||
|
}
|
||
|
passDec()
|
||
|
|
||
|
console.log('process.cwd(): ', process.cwd())
|