1.0.0 • Published 4 years ago

oris-validator v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

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

ParamType
inputPasswordstring
saltstring
storedHashstring

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

ParamType
passwordstring

hashAndSalt : Object

Kind: global typedef Properties

NameTypeDescription
hashstringThe hash
saltstringThe salt used for hashing