db.js
/**
 * Hash a password with bcrypt, returns a new Promise.
 * @param {*} password Unhashed, raw password from user input
 * @returns {String} Hashed password
 */
Hash a password with bcrypt, returns a new Promise.
@param {*} password Unhashed, raw password from user input
@returns {String} Hashed password
Hash a password with bcrypt returns a new Promise . @param { * } password Unhashed raw password from user input @returns { String } Hashed password
function hashPassword(password) {
  return new Promise((resolve, reject) => {
    bcrypt.hash(password, 10, function(err, hash) {
      if (err) reject(err);
      resolve(hash);
    });
  });
}
function hashPassword ( password ) { return new Promise ( ( resolve , reject ) => { bcrypt . hash ( password , 10 , function ( err , hash ) { if ( err ) reject ( err ) ; resolve ( hash ) ; } ) ; } ) ; }
Hash a password with bcrypt, returns a new Promise.
Hash a password with bcrypt returns a new Promise .
// Use the bcrypt library to hash the password, 