# @frontendmonster/password

> hash and compare passwords

Latest version **2.0.0** (published 2019-01-21) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @frontendmonster/password
pnpm add @frontendmonster/password
yarn add @frontendmonster/password
bun add @frontendmonster/password
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2019-01-21 |
| First published | 2018-09-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| Author | frontendmonster |
| Maintainers | frontendmonster |

## Links

- npm: https://www.npmjs.com/package/@frontendmonster/password
- Repository: https://github.com/frontendmonster/password
- Homepage: https://github.com/frontendmonster/password#readme
- Issues: https://github.com/frontendmonster/password/issues
- npm.io page: https://npm.io/package/@frontendmonster/password

## Dependencies (3)

- [bcryptjs](https://npm.io/package/bcryptjs.md) ^2.4.3
- [rand-token](https://npm.io/package/rand-token.md) ^0.4.0
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.4.0

## Recent versions

- 2.0.0 (latest) — 2019-01-21
- 1.0.0 — 2018-09-24

## README

# password

useful encryption and jwt utils

## Usage

```javascript
import { hash, compare, uid, decode, sign, verify } from '@frontendmonster/password';

const hashedPassword = await hash(password, salt); // hash password with specific salt
const await compare(userPassword, hasedPassword); // compare hashed passwords
const token = uid(16); // crate 16-len uid
const jwt = sign(payload, secret, option); // sign json web token
const isValid = verify(jwt, tokn); // verify json web token
const payload = decode(jwt); // decode json web token
```

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