Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

password-hashing-entreprenerd

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

password-hashing-entreprenerd

A simple TS package used for password generation and verification

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

password-hashing

A simple package to hash passwords and verify if the password and the hash match

Installation

yarn add password-hashing

## Usage

import { validatePassword, hashPassword } from "password-hashing"

const { hash, salt } = hashPassword("YOUR PASSWORD")

const isValid = validatePassword("YOUR PASSWORD", salt, hash) // Is the password valid?

Functions

validatePassword(inputPassword, salt, storedHash)boolean

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

hashPassword(password)HashAndSalt

Given a Password, hash it with a salt, then return the hash and the salt

Typedefs

HashAndSalt : Object

validatePassword(inputPassword, salt, storedHash) ⇒ boolean

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

Kind: global function
Returns: boolean - does hash(inputPassword + salt) === storedHash?

ParamType
inputPasswordstring
saltstring
storedHashstring

hashPassword(password) ⇒ HashAndSalt

Given a Password, hash it with a salt, then return the hash and the salt

Kind: global function
Returns: HashAndSalt - object containing the hash and the salt used

ParamType
passwordstring

HashAndSalt : Object

Kind: global typedef
Properties

NameTypeDescription
hashstringThe hash we got
saltstringThe salt used to hash

FAQs

Package last updated on 07 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc