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
yarn add password-hashing
import { validadePassword, hashPassword } from {otavio-password-pack};
const { const, salt } = hashPassword("YOUR PASSWORD");
const isValid = validatePassword("YOUR PASSWORD", salt, hash)
-
validadePassword(inputPassword, salt, storedHash) ⇒
boolean
-
Given the input, salt and the stored hash, return if the password is valod or no.
-
hashPassword(password) ⇒
HashAndSalt
-
Given the password and the salt, returns a hash for the password and the salt.
-
HashAndSalt :
Object
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 |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
hash | string |
The hash we got |
salt | string |
The salt used for the hash |