Created
March 20, 2021 22:53
-
-
Save Khuzha/a864240064b4805a51b70c67315020d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const bcrypt = require('bcrypt'); | |
const src = 'hello world'; | |
const salt = bcrypt.genSaltSync(10); | |
const hash1 = bcrypt.hashSync(src, salt); | |
const hash2 = bcrypt.hashSync(src, salt); | |
console.log(`src = ${src}`); | |
console.log(`salt = ${salt}\n`); | |
console.log(`hash 1 = ${hash1}`); | |
console.log(`hash 2 = ${hash2}\n`); | |
console.log(`compare 1 = ${bcrypt.compareSync(src, hash1)}`); | |
console.log(`compare 2 = ${bcrypt.compareSync(src, hash2)}`); | |
Author
Khuzha
commented
Mar 20, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment