UNPKG

bcrypt-strong-password-hasher

Version:

A secure, zero-dependency password hasher using native Node.js crypto

34 lines (23 loc) 658 B
# bcrypt-strong-password-hasher A secure, zero-dependency password hashing library using native Node.js crypto. ## Features - PBKDF2-HMAC-SHA512 hashing - Auto salt generation - Optional pepper support - Configurable iterations and key length - Timing-safe comparison - Async/Promise API - JSON metadata output for easy storage ## Usage ```js import { hashPassword, verifyPassword } from 'bcrypt-strong-password-hasher'; const pepper = process.env.APP_SECRET || ''; const hashed = await hashPassword('admin123', { pepper }); const isValid = await verifyPassword('admin123', hashed, pepper); ``` ## Running Tests ```bash npm test ``` ## License MIT