@radzor/password-hash
Secure password hashing with bcrypt or Argon2id. Includes strength validation, comparison timing-safe, and configurable cost parameters. Zero external dependencies for bcrypt (uses Node.js crypto).
Install
View source on GitHub →Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| algorithm | 'bcrypt' | 'argon2id' | bcrypt | Hashing algorithm. bcrypt is widely supported; argon2id is the current OWASP recommendation. |
| rounds | number | 12 | bcrypt cost factor (rounds). Higher = slower = more secure. Recommended: 10-14. |
| memoryCost | number | 65536 | Argon2id memory cost in KiB (default: 64MB). |
| timeCost | number | 3 | Argon2id iteration count. |
Hashing algorithm. bcrypt is widely supported; argon2id is the current OWASP recommendation.
default: bcrypt