Testing bcrypt

node v10.13.0
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 = '[email protected]'; 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