1.0.0 • Published 1 year ago

study-test-package v1.0.0

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

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

ParamType
inputPasswordstring
saltstring
storedHashstring

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

NameTypeDescription
hashstringThe hash we got
saltstringThe salt used for the hash
1.0.0

1 year ago