1.0.0 • Published 3 years ago

@altcmdio/password-utils v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

@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))