📜  bcrypt 与哈希比较 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:41.029000             🧑  作者: Mango

代码示例3
// password: the value passed from the password form input
// hash: the value requested from the database. This is the "encrypted" password
bcrypt.compare(password, hash).then(validPass => {
    // validPass returns true or false
    }.catch(err => console.log('error: ' + err));