📜  bcrypt gensalt - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:42.790000             🧑  作者: Mango

代码示例1
const bcrypt = require ('bcrypt');

const saltRounds = 10;

bcrypt.genSalt(saltRounds, function(err, salt) {
  // returns salt
});

// or

bcrypt.genSalt(saltRounds, function(err, salt) {
  bcrypt.hash(password, salt, function(err, hash) {
  // returns hash
  console.log(hash);
  });
});