secure-password-hash

1.0.1 • Public • Published

Secure-password-hash

Secure-Hash is a Node.js package for securely hashing and verifying passwords.

Installation

To install the package, run the following command:

npm install secure-password-hash

Usage

Require the secure-hash package in your code to access its functionality:

const { hashPassword, verifyPassword } = require("secure-hash");

Hashing Passwords

To hash passwords, use the hashPassword function provided by the package. Here's an example:

const password = "userPassword";
const hashedPassword = hashPassword(password);
console.log("Hashed password:", hashedPassword);

Verifying Passwords

To verify passwords, use the verifyPassword function provided by the package. Here's an example:

const password = "userPassword";
const isMatch = verifyPassword(
  password,
  hashedPassword.hash,
  hashedPassword.salt
);
console.log("Password match:", isMatch);

Package Sidebar

Install

npm i secure-password-hash

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

2.33 kB

Total Files

4

Last publish

Collaborators

  • codewithchengc