This package has been deprecated

Author message:

the bcrypt module supports promises now, this module is no longer necessary

bcrypt-as-promised

1.1.0 • Public • Published

bcrypt-as-promised

Build Status

A promisified version of bcrypt

Install via NPM

npm install bcrypt-as-promised

Basic Usage

hashing:

bcrypt.hash('my password', 10)
  .then(console.log, console.error)

comparing:

bcrypt.compare('my password', someHash)
  .then(console.log, console.error)

Note: an invalid password/hash combo errors as a rejected promise

The rejection can be checked against instanceof bcrypt.MISMATCH_ERROR

bcrypt.compare('invalid password', someHash)
  .then(handleValidPassword)
  .catch(bcrypt.MISMATCH_ERROR, handleInvalidPassword)
  .catch(handleOtherErrors);

generating a salt:

bcrypt.genSalt(10)
  .then(console.log, console.error)

calculating the rounds used in a salt:

bcrypt.getRounds(someHash)
  .then(console.log, console.error)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published

Package Sidebar

Install

npm i bcrypt-as-promised

Weekly Downloads

7

Version

1.1.0

License

MIT

Last publish

Collaborators

  • monteslu