pbkdf2-password.js
function genHashWithDigest(opts, cb) {
    crypto.pbkdf2(opts.password, opts.salt, iterations, keyLength, digest, function(err, hash) {
      if (typeof hash === 'string') {
        hash = new Buffer(hash, 'binary');
      }

      cb(err, opts.password, opts.salt.toString("base64"), hash.toString("base64"));
    });
  }
function genHashWithDigest(opts, cb) {
    crypto.pbkdf2(opts.password, opts.salt, iterations, keyLength, digest, function(err, hash) {
      if (typeof hash === 'string') {
        hash = new Buffer(hash, 'binary');
      }

      cb(err, opts.password, opts.salt.toString("base64"), hash.toString("base64"));
    });
  }
function genHashWithDigest ( opts , cb ) { crypto . pbkdf2 ( opts . password , opts . salt , iterations , keyLength , digest , function ( err , hash ) { if ( typeof hash === 'string' ) { hash = new Buffer ( hash , 'binary' ) ; } cb ( err , opts . password , opts . salt . toString ( "base64" ) , hash . toString ( "base64" ) ) ; } ) ; }
Generates a new hash using the password and the salt

The callback will be called with the following arguments:
- the error, if something when wrong.
- the password.
- the salt, encoded in base64.
- the hash, encoded in base64.

@api private
@param {Object} opts The options used to generate the hash (password & salt)
@param {Function} cb The callback
Generates a new hash using the password and the salt