oris-validator

1.0.0 • Public • Published

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

validatePassword(inputPassword, salt, storedHash)boolean

Given an input password a salt and a hash Does the given password match with the hash?

hashPassword(password)hashAndSalt

Given a password, hash it with a salt and return the hash and salt

Typedefs

hashAndSalt : Object

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

Readme

Keywords

none

Package Sidebar

Install

npm i oris-validator

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

1.03 MB

Total Files

49

Last publish

Collaborators

  • blackwolf