“npm bcrypt” Réponses codées

Installer BCrypt

>> npm install bcrypt

const bcrypt = require('bcrypt');
Ham-Solo

Installer BCrypt

npm install bcryptjs
Clever Crane

bcryptjs

npm i bcryptjs

# yarn
yarn add bcryptjs
Salo Hopeless

Installer BCrypt

npm install bcrypt
Clever Crane

npm bcrypt

const bcrypt = require('bcrypt');
const saltRounds = 10;

bcrypt.hash(myPlaintextPassword, saltRounds, function(err, hash) {
    // Store hash in your password DB.
});

// Load hash from your password DB.
bcrypt.compare(myPlaintextPassword, hash, function(err, result) {
    // result == true
});
Udituk

npm bcrypt

// Load hash from your password DB.
bcrypt.compare(myPlaintextPassword, hash, function(err, result) {
    // result == true
});
bcrypt.compare(someOtherPlaintextPassword, hash, function(err, result) {
    // result == false
});
Dev Mahir

Réponses similaires à “npm bcrypt”

Questions similaires à “npm bcrypt”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code