aichholzer / promised-bcrypt

Promised bcrypt goodness.
MIT License
0 stars 0 forks source link

promised-bcrypt

Greenkeeper badge Build 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

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