password-helper/README.md

33 lines
555 B
Markdown
Raw Normal View History

2020-05-17 17:23:22 +02:00
# @sapphirecode/password-helper
2020-03-06 08:38:14 +01:00
2020-05-17 17:23:22 +02:00
version: 1.0.x
easy password storage with argon2
## Installation
npm:
> npm i --save @sapphirecode/password-helper
yarn:
> yarn add @sapphirecode/password-helper
## Usage
2020-03-06 08:38:14 +01:00
```js
const password_helper = require('@scode/password-helper');
2020-05-17 17:23:22 +02:00
// create a hash
2020-03-06 08:38:14 +01:00
const hash = await password_helper.hash('foo');
2020-05-17 17:23:22 +02:00
// verify a password using the hash
2020-03-06 08:38:14 +01:00
await password_helper.verify(hash, 'foo'); // returns true;
await password_helper.verify(hash, 'bar'); // returns false;
```
2020-05-17 17:23:22 +02:00
## License
MIT © Timo Hocker <timo@scode.ovh>