Created
October 18, 2020 14:50
-
-
Save nosvalds/5f111039a7d09caceefaff917b55d18e to your computer and use it in GitHub Desktop.
password hashing function
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('bcryptjs') | |
/** | |
* Hash password | |
* @param string password | |
*/ | |
const hashPassword = (password) => { | |
const salt = bcrypt.genSaltSync(10) | |
return bcrypt.hashSync(password, salt) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment