study-test-package

1.0.0 • Public • Published

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

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.

Typedefs

HashAndSalt : Object

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

Readme

Keywords

none

Package Sidebar

Install

npm i study-test-package

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

1.03 MB

Total Files

49

Last publish

Collaborators

  • otaviootavio