1.0.0 • Published 3 years ago
@altcmdio/password-utils v1.0.0
@altcmdio/password-utils
usage
// Make sure you specify "type": "module" in your own package.json
// to be able to use 'import' and 'await' at the top-level.
import * as passwordUtils from '@altcmdio/password-utils'
const passwd = await passwordUtils.generate(16)
// deafult is 16 hex chars
const hash = await passwordUtils.hash(passwd, 10)
// default is 10 salt rounds
console.log(passwd, hash)
console.log(await passwordUtils.compare(passwd, hash))
1.0.0
3 years ago