Skip to content

Instantly share code, notes, and snippets.

@tychobrailleur
Created November 18, 2021 13:43
Show Gist options
  • Save tychobrailleur/210194dd0c5fa4852681a5c305f9c934 to your computer and use it in GitHub Desktop.
Save tychobrailleur/210194dd0c5fa4852681a5c305f9c934 to your computer and use it in GitHub Desktop.
const bcrypt = require('bcrypt');
const saltRounds = 12;
const myPassword = "password";
bcrypt.genSalt(saltRounds, function(err, salt) {
bcrypt.hash(myPassword, salt, function(err, hash) {
console.log("Hash: " + hash);
// Store hash in your password DB.
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment