1.0.2 • Published 9 years ago

nu-bcrypt v1.0.2

Weekly downloads
7
License
MIT
Repository
github
Last release
9 years ago

nu-bcrypt

Build Status Codecov npm version Dependency Status devDependency Status Known Vulnerabilities

A library for interfacing with bcrypt using promises.

Install

npm install nu-bcrypt

#hash(str, rounds)


Example

const bcrypt = require('nu-bcrypt');

bcrypt.hash('password', 10).then(function (result) {
    // result === hashed string
});

#compare(str, hash)


Example

const bcrypt = require('nu-bcrypt');

const hash = bcrypt.hash('password', 12);

bcrypt.compare('password', hash).then(function (result) {
    // result === true
});

bcrypt.compare('incorrect', hash).then(function (result) {
    // result === false
});

#getRounds(hash)


Example

const bcrypt = require('nu-bcrypt');

const hash   = bcrypt.hash('password', 12);
const rounds = bcrypt.getRounds(hash);

// rounds === 12

License

MIT

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago