Skip to content

Instantly share code, notes, and snippets.

@nosvalds
Created October 18, 2020 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nosvalds/5f111039a7d09caceefaff917b55d18e to your computer and use it in GitHub Desktop.
Save nosvalds/5f111039a7d09caceefaff917b55d18e to your computer and use it in GitHub Desktop.
password hashing function
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