src/lib/db.js
function hashToken(token, done) {
  return bcrypt.genSalt(10, function(genSaltErr, salt) {
    if (genSaltErr) {
      return done(genSaltErr);
    }

    bcrypt.hash(token, salt, done);
  });
}
function hashToken(token, done) {
  return bcrypt.genSalt(10, function(genSaltErr, salt) {
    if (genSaltErr) {
      return done(genSaltErr);
    }

    bcrypt.hash(token, salt, done);
  });
}
function hashToken ( token , done ) { return bcrypt . genSalt ( 10 , function ( genSaltErr , salt ) { if ( genSaltErr ) { return done ( genSaltErr ) ; } bcrypt . hash ( token , salt , done ) ; } ) ; }
Hash a token. We shall not store the token in plain text for security
purposes.

@param {String} token
@param {Function} done - done(err, hash)
Hash a token . We shall not store the token in plain text for security purposes .