promised-bcrypt

0.2.4 • Public • Published

promised-bcrypt

Build Status Dependency status Downloads Always useful

Promised bcrypt goodness. git rebase

🔥 This module has been deprecated since the introduction of bcrypt v1.0.0.

Install

npm install --save promised-bcrypt

API

  • .hash(string, rounds) - {rounds} defaults to 10.
  • .compare(string, hash)
  • .genSalt(rounds) - {rounds} defaults to 10.
  • .getRounds(hash)

All of these return a Promise.

Use

const bcrypt = require('promised-bcrypt');
bcrypt.hash('Hello')
    .then(hash => {
        console.log(hash);
    });

// '$2a$10$LriA/LnuQRIh63uyGU8t6TFwp)9y^wnLd3fw0duLnhe0SN.vS.Pka'
const bcrypt = require('promised-bcrypt');
bcrypt.compare('Hello', hash)
    .then(pass => {
        console.log(pass);
    });

// true
const bcrypt = require('promised-bcrypt');
bcrypt.getRounds(hash)
    .then(rounds => {
        console.log(rounds);
    });

// 10

Contribute

fork https://github.com/aichholzer/promised-bcrypt

Further reading

https://github.com/kelektiv/node.bcrypt.js

License

MIT

Package Sidebar

Install

npm i promised-bcrypt

Weekly Downloads

0

Version

0.2.4

License

MIT

Last publish

Collaborators

  • saichholzer