pass-hash-ts
v1.0.3
Published
A simple TS package used for password generation and verification
Downloads
6
Readme
pass-hash-ts
A simple ts package to hash a password and verify if the hash and password match
Installation
Install pass-hash-ts with yarn
yarn add pass-hash-ts
Usage/Examples
import { validatePassword, hashPassword } from "pass-hash-ts";
const { hash, salt } = hashPassword("<PASSWORD>");
const isValidate = validatePassword(pass, salt, hash);
Functions
Typedefs
validatePassword(inputPassword, salt, storedHash) ⇒ boolean
Given an inputPassword + salt + hash Does the given password match hash
Kind: global function
Returns: boolean - does hash( inputPassword + salt + hash) === storedHash
| Param | Type | | ------------- | ------------------- | | inputPassword | string | | salt | string | | storedHash | string |
hashPassword(password) ⇒ HashAndSalt
Given a password, hash it with a salt, then return hash and salt
Kind: global function
Returns: HashAndSalt - object containing hash and salt
| Param | | -------- | | password |
HashAndSalt : Object
Kind: global typedef
Properties
| Name | Description | | ---- | ------------- | | hash | hash returned | | salt | salt returned |