The code for this lesson goes between the
//END_SYNC lines in your server file.
hashSync() method to hash a
plain text password with a specific number of
salt rounds, and set the results to a variable.
Then use bcrypt’s
compareSync() method to compare a
plain text password against the variable.
Solution 1 (Click to Show/Hide)
- In the
let hash = bcrypt.hashSync(myPlaintextPassword, saltRounds); console.log(hash); let result = bcrypt.compareSync(myPlaintextPassword, hash); console.log(result);
- Check the console to see the results from the methods.
Note: Be sure to submit the link to the live demo of your project.