pbkdf2-password-hash
Version:
hash password with pbkdf2
11 lines (8 loc) • 298 B
JavaScript
const SEP = '$'
function convert (passwordHash) {
let [digest, iterations, keylen, salt, hash] = passwordHash.split(SEP)
salt = Buffer.from(salt).toString('base64')
const newPasswordHash = [digest, iterations, keylen, salt, hash].join(SEP)
return newPasswordHash
}
export default convert