Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

pswd

3.0.3 • Public • Published

pswd

NPM version Build status Test coverage Dependency Status License Downloads

Similar to pwd. Designed with promises for cleaner code, especially with generators. Also, pwd doesn't actually work with generators, and I'm too lazy to fix it. bcrypt also doesn't support node 0.11 yet :( but not installing C/C++ addons to do password hashing is always nice.

  • Supports changing passwords with different iterations and lengths
  • Returns a single string like bcrypt

API

var pswd = require('pswd')([options])

These options can also be set and changed by doing pswd[option] = Integer.

  • length <128> - salt and pbkdf2 byte length
  • iterations <12000> - pbkdf2 iteration count

pswd.hash(password, [salt], [iterations], [length]).then( hash => )

Creates a hash from the password with optional salt, iterations, and length arguments (used for comparision).

pswd.compare(password, hash).then( okay => )

Compare a password with a hash. okay is a Boolean.

install

npm i pswd

Downloadsweekly downloads

9

version

3.0.3

license

MIT

repository

githubgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar