Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aichholzer/promised-bcrypt
Promised bcrypt goodness.
https://github.com/aichholzer/promised-bcrypt
Last synced: 25 days ago
JSON representation
Promised bcrypt goodness.
- Host: GitHub
- URL: https://github.com/aichholzer/promised-bcrypt
- Owner: aichholzer
- License: mit
- Created: 2016-10-12T03:05:17.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-08-20T14:44:16.000Z (about 4 years ago)
- Last Synced: 2024-10-02T17:16:57.034Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# promised-bcrypt
[![Greenkeeper badge](https://badges.greenkeeper.io/aichholzer/promised-bcrypt.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.org/aichholzer/promised-bcrypt.svg?branch=master)](https://travis-ci.org/aichholzer/promised-bcrypt)
[![Downloads](https://img.shields.io/npm/dt/promised-bcrypt.svg)](https://www.npmjs.com/package/promised-bcrypt)
[![Always useful](https://img.shields.io/badge/always-useful-ff6400.svg)](https://github.com/aichholzer/promised-bcrypt)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](https://github.com/kelektiv/node.bcrypt.js)
### License
[MIT](https://github.com/aichholzer/promised-bcrypt/blob/master/LICENSE)