password_hash

1.1.0 • Public • Published

password_hash

a Node version of php's password_hash

Generating a Salt

password_hash().salt([Optional] saltSize);

saltSize: number of bytes (optional, default=16)

Hashing a Password

password_hash(password).hash(salt, [Optional] iterations, [Optional] keylen);

password: plaintext password to hash

salt: salt to use for hash

iterations: number of iterations to hash (optional, default=1000)

keylen: number of bytes (optional, default=64)

Verifying a Password

password_hash(password).verify(pack);

password: plaintext password to verify

pack: the hashed password and info returned from .hash(...);

Find on NPM

https://www.npmjs.com/package/password_hash

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    154
    • latest

Version History

Package Sidebar

Install

npm i password_hash

Weekly Downloads

154

Version

1.1.0

License

ISC

Unpacked Size

2.13 kB

Total Files

3

Last publish

Collaborators

  • mochlate