1.0.0 • Published 1 year ago
study-test-package v1.0.0
Package NPM Study
Just made it to understand how to build a typescript package. I totally followed this video https://www.youtube.com/watch?v=RnAJNCj0ut0&t=231s
Instalation
yarn add password-hashing
Usage
import { validadePassword, hashPassword } from {otavio-password-pack};
const { const, salt } = hashPassword("YOUR PASSWORD");
const isValid = validatePassword("YOUR PASSWORD", salt, hash)
Functions
Typedefs
validadePassword(inputPassword, salt, storedHash) ⇒ boolean
Given the input, salt and the stored hash, return if the password is valod or no.
Kind: global function
Param | Type |
---|---|
inputPassword | string |
salt | string |
storedHash | string |
hashPassword(password) ⇒ HashAndSalt
Given the password and the salt, returns a hash for the password and the salt.
Kind: global function
Returns: HashAndSalt - object containing the hash and the salt used.
Param |
---|
password |
HashAndSalt : Object
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
hash | string | The hash we got |
salt | string | The salt used for the hash |
1.0.0
1 year ago