<commit_before># pswd

[![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Dependency Status][david-image]][david-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![Gittip][gittip-image]][gittip-url]

Similar to [pwd](https://github.com/visionmedia/node-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( hash => )

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

[npm-image]: https://img.shields.io/npm/v/pswd.svg?style=flat-square
[npm-url]: https://npmjs.org/package/pswd
[github-tag]: http://img.shields.io/github/tag/thenables/pswd.svg?style=flat-square
[github-url]: https://github.com/thenables/pswd/tags
[travis-image]: https://img.shields.io/travis/thenables/pswd.svg?style=flat-square
[travis-url]: https://travis-ci.org/thenables/pswd
[coveralls-image]: https://img.shields.io/coveralls/thenables/pswd.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/thenables/pswd?branch=master<commit_msg>fix(docs): update pswd.compare().then() docs<commit_after># pswd

[![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Dependency Status][david-image]][david-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![Gittip][gittip-image]][gittip-url]

Similar to [pwd](https://github.com/visionmedia/node-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`.

[npm-image]: https://img.shields.io/npm/v/pswd.svg?style=flat-square
[npm-url]: https://npmjs.org/package/pswd
[github-tag]: http://img.shields.io/github/tag/thenables/pswd.svg?style=flat-square
[github-url]: https://github.com/thenables/pswd/tags
[travis-image]: https://img.shields.io/travis/thenables/pswd.svg?style=flat-square
[travis-url]: https://travis-ci.org/thenables/pswd
[coveralls-image]: https://img.shields.io/coveralls/thenables/pswd.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/thenables/pswd?branch=master
{'fraction_non_alphanumeric': 0.16716176073453956, 'fraction_numerical': 0.0070213340534701595, 'mean_word_length': 5.364261168384879, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5761823', 'n_tokens_mistral': 1317, 'n_tokens_neox': 1265, 'n_words': 302}