Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

Testing bcrypt

node v10.24.1
version: 2.0.0
endpointsharetweet
// 1. Use this to hash and salt the 'password' const bcrypt = require('bcryptjs'); const salt = bcrypt.genSaltSync(10); const passwordToHash = 'password@123'; const hash = bcrypt.hashSync(passwordToHash, salt); console.log('HASH: ', hash); // const passwordToCompare = 'wrongpassword'; const isValid = bcrypt.compareSync(passwordToHash, hash); console.log('IS VALID?: ', isValid);
Loading…

no comments

    sign in to comment