This package has been deprecated

Author message:

Use plain bcrypt, it support promises now

bcrypt-promised

1.0.1 • Public • Published

bcrypt-promised

A promised version of bcrypt.

Installation

Take note that you need also to add bcrypt to your package.json as it linked as peer dependency.

npm i bcrypt-promised bcrypt --save

API

Take note that this module return error (MismatchError) when compare fails.

Check out README of original bcrypt to get meaning of all this.

import bcrypt from 'bcrypt-promised';
 
bcrypt.genSalt(saltRounds).then(salt => {
  console.log(salt);
});
 
bcrypt.hash(myPlaintextPassword, saltRounds).then(hash => {
  console.log(hash);
});
 
bcrypt.compare(plaintextPassword, hash).then(password => {
  console.log(password);
}).catch(err => {
  console.log(err);
});
 
bcrypt.getRounds(encrypted);

Package Sidebar

Install

npm i bcrypt-promised

Weekly Downloads

2

Version

1.0.1

License

ISC

Last publish

Collaborators

  • anton.nesterov