Skip to content

Instantly share code, notes, and snippets.

@jaydeepakbari
Last active June 29, 2018 10:02
Show Gist options
  • Save jaydeepakbari/4ec5f66eaab271c42ef588fed15fcb5a to your computer and use it in GitHub Desktop.
Save jaydeepakbari/4ec5f66eaab271c42ef588fed15fcb5a to your computer and use it in GitHub Desktop.
Example of using bcrypt with mongoose to encript password with bcrypt
var mongoose = require('mongoose'),Schema = mongoose.Schema;
var bcrypt = require('bcrypt');
var salt = bcrypt.genSaltSync(10);
var enc_password = password = bcrypt.hashSync(req.body.password, salt);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment