1.0.0 • Published 1 year ago
password-hasher-bgc v1.0.0
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
Kind: global function Returns: boolean - does hash(inputPassword + ssalt) === storedHash?
Param | Type |
---|---|
inpitPassword | string |
salt | string |
storeHashed | string |
hashPassword(password) ⇒ HaskedSalt
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 |
1.0.0
1 year ago