abhi-bcrypt
v1.0.2
Published
A lightweight bcrypt-like hashing library for Node.js.
Downloads
15
Readme
abhi-bcrypt
A lightweight bcrypt-like hashing library for Node.js.
Installation
npm install abhi-bcrypt
Usage
import { hashPassword, comparePassword, extractSaltAndHash } from "abhi-bcrypt";
const password = "yourPassword";
const hashedPassword = hashPassword(password);
// Comparing passwords
console.log(comparePassword(password, hashedPassword)); // true
console.log(comparePassword("wrongPassword", hashedPassword)); // false
// Extract salt and hash
const { salt, hash } = extractSaltAndHash(hashedPassword);
console.log("Salt:", salt);
console.log("Hash:", hash);