# bcrypt-cached

> Use memory cached results for bcrypt

Latest version **0.0.1** (published 2017-04-20) · LGPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install bcrypt-cached
pnpm add bcrypt-cached
yarn add bcrypt-cached
bun add bcrypt-cached
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-04-20 |
| First published | 2017-04-20 |
| Weekly downloads | 0 |
| License | LGPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Cristóvão Trevisan |
| Maintainers | cristovao-trevisan |
| Keywords | cache, bcrypt, memory |

## Links

- npm: https://www.npmjs.com/package/bcrypt-cached
- Repository: https://github.com/cristovao-trevisan/bcrypt-cached
- Homepage: https://github.com/cristovao-trevisan/bcrypt-cached#readme
- Issues: https://github.com/cristovao-trevisan/bcrypt-cached/issues
- npm.io page: https://npm.io/package/bcrypt-cached

## Dependencies (2)

- [bcrypt](https://npm.io/package/bcrypt.md) ^1.0.2
- [node-cache](https://npm.io/package/node-cache.md) ^4.1.1

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2017-04-20

## README

# bcrypt-cached

Use memory cached results for bcrypt

Example:
```javascript
const bcryptCached = require('bcrypt-cached')

var myCache = new bcryptCached({
  ttl: 60, // default = 600
  checkperiod: 20 // default = 60
})

const plainTextPassword = '12345678'
const hash = '$2a$10$EotbI1GgQMZMg3siykIgKeSZe4MwF52pYj5FBd1fGdNiszP7RQGNu'

console.log(process.hrtime())
// saving to cache
myCache.compare(hash, plainTextPassword).then((res) => {
  console.log(process.hrtime(), res)
  // running really fast (≃ 1000 faster for a single core)
  myCache.compare(hash, plainTextPassword).then((res) => {
    console.log(process.hrtime(), res)
  })
})

```

---
_Source: https://npm.io/package/bcrypt-cached · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
