Files
gunbuilder-next-tailwind/check_hash_pw.js

10 lines
406 B
JavaScript

const bcrypt = require('bcryptjs');
// Replace with your plaintext password and hash
const plaintextPassword = 'newpassword'; // <-- put your real password here
const hash = '$2b$10$n78/VuxwnDoOemWoqjVKnunz5PZy7SisG3VUhsPtQXKEEnMej6TWK';
bcrypt.compare(plaintextPassword, hash, (err, result) => {
if (err) throw err;
console.log('Password matches hash?', result); // true if matches, false if not
});