1.0.0 • Published 1 year ago

password-hasher-bgc v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

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?

ParamType
inpitPasswordstring
saltstring
storeHashedstring

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

ParamType
passwordstring
1.0.0

1 year ago