How to use the bcrypt.genSaltAsync function in bcrypt

To help you get started, we’ve selected a few bcrypt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sirodoht / aspen / back / models / user.model.js View on Github external
const hashPasswordHook = function (user) {
    return bcrypt.genSaltAsync(SALT_WORK_FACTOR)
      .then(function (salt) {
        return bcrypt.hashAsync(user.password, salt)
          .then(function (hash) {
            user.password = hash;
          });
      })
      .catch(function (err) {
        console.log('Password hook error:', err);
      });
  };
github catamphetamine / webapp / backend / code / password-service / api / password.js View on Github external
async function hash_password(password)
{
	const salt = await bcrypt.genSaltAsync(10)
	return await bcrypt.hashAsync(password, salt)
}
github catamphetamine / webapp / code / password-service / api / password.js View on Github external
async function hash_password(password)
{
	const salt = await bcrypt.genSaltAsync(10)
	return await bcrypt.hashAsync(password, salt)
}