oris-validator
v1.0.0
Published
A simple package to hash password and verify if the passwords match
Downloads
2
Readme
validator-package
A simple package to hash password and verify if the passwords match
Installation
yarn add validator-package
Usage
import { validatePassword, hashPassword } from "validator-package";
const { hash, salt } = hashPassword("YOUR PASSWORD");
const isValid = validatePassword("YOUR PASSWORD", salt, hash);
Functions
Typedefs
validatePassword(inputPassword, salt, storedHash) ⇒ boolean
Given an input password a salt and a hash Does the given password match with the hash?
Kind: global function
| Param | Type | | ------------- | ------------------- | | inputPassword | string | | salt | string | | storedHash | string |
hashPassword(password) ⇒ hashAndSalt
Given a password, hash it with a salt and return the hash and salt
Kind: global function Returns: hashAndSalt - Object containing hash and salt used
| Param | Type | | -------- | ------------------- | | password | string |
hashAndSalt : Object
Kind: global typedef Properties
| Name | Type | Description | | ---- | ------------------- | ------------------------- | | hash | string | The hash | | salt | string | The salt used for hashing |