Skip to content

Instantly share code, notes, and snippets.

@dpjayasekara
Forked from deepal/encrypt.js
Created October 14, 2019 21:11
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 dpjayasekara/e5ae361557c931589d48eed8f2de2bf2 to your computer and use it in GitHub Desktop.
Save dpjayasekara/e5ae361557c931589d48eed8f2de2bf2 to your computer and use it in GitHub Desktop.
Encrypt with bcrypt
const bcrypt = require('bcrypt');
module.exports = (plainText) => {
const salt = bcrypt.genSaltSync(12);
return bcrypt.hashSync(plainText, salt);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment