A nodejs CRYPT(3) N-API module for password encrypt and verify.
$ npm install crypt3-passwd
- password (required)
- salt (optional): if missing, will auto create random salt (length=16) without rounds part
- algo (optional): 'md5'|'sha256'|'sha512'(default)
const crypt3 = require('crypt3-passwd')
crypt3.verify(
'jimmy',
crypt3.encrypt('jimmy', 'salt', 'sha512')
)
// user-supplied hashing rounds support as well
crypt3.verify(
'jimmy',
crypt3.encrypt('jimmy', 'rounds=1000$salt')
)
// rounds number should be between `1000` and `999999999`
// see: https://man7.org/linux/man-pages/man3/crypt.3.html for more details