# hash-password

> hash salt password

Latest version **0.1.1** (published 2020-03-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install hash-password
pnpm add hash-password
yarn add hash-password
bun add hash-password
```

## 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.1.1 |
| Published | 2020-03-07 |
| First published | 2020-03-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jazz Brown |
| Maintainers | jazzbrown1 |

## Links

- npm: https://www.npmjs.com/package/hash-password
- npm.io page: https://npm.io/package/hash-password

## Recent versions

- 0.1.1 (latest) — 2020-03-07

## README

# hash-password

A tiny library to hash and salt passwords.

## Usage
~~~
// make a generator passing options is optional
const pw = password({
  algorithm: 'sha512',
  encoding: 'hex',
  saltLength: 16
});

// create a password hash object from a raw text password
const hashed = pw.generate('aaa');
console.log(hashed); // -> { hash: abcdefghijklmnopqusrtuvwxyz1234567890, salt: 1234567890123456 }

// check if raw text password matches hashed password
console.log(pw.validate('aaa', hashed)); // -> true
console.log(pw.validate('bbb', hashed)); // -> false
~~~

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