password-hasher-bgc
A simple typescript library used for password generation and verification
Instalation
yarn add password-hasher-bgc
npm install password-hasher-bgc
Usage
import {validatePAssword, hashedPassword} from "password-hasher-bgc"
const {hash,salt} = hashPasword("yourpasword)
const isValid = validatePasword("yourpassword, salt,hash)
Functions
-
validatePassword(inpitPassword, salt, storeHashed) ⇒
boolean
-
Given an input password a salt and an hash Does the given password match with the hash
-
hashPassword(password) ⇒
HaskedSalt
-
Given a password, hash it with a solt , then return the hash and the salt
boolean
validatePassword(inpitPassword, salt, storeHashed) ⇒ Given an input password a salt and an hash Does the given password match with the hash
Kind: global function
Returns: boolean
- does hash(inputPassword + ssalt) === storedHash?
Param | Type |
---|---|
inpitPassword | string |
salt | string |
storeHashed | string |
HaskedSalt
hashPassword(password) ⇒ Given a password, hash it with a solt , then return the hash and the salt
Kind: global function
Returns: HaskedSalt
- object containing the hash ant the salt
Param | Type |
---|---|
password | string |