1.0.1 • Published 9 years ago
nh-cryptohash v1.0.1
node-cryptohash
A super simple library to create password hmac-sha1 hashes using the Node.js crypto module.
var hasher = require('nh-cryptohash')
set options hasher.options = {
}
Object createHash(password String, salt String)
returns { hashedPassword: string, salt: string }
The salt is randomly generated using pseudoRandomBytes if none is given.
Boolean verifyHash(password, salt, pWhash)
password can be the password to check (for example read from input field)
salt is the salt used to initially hash the password (for example stored in db)
pWhash is the stored hash of the initial password (for example stored in db)
Then returns true or false