Hash a password using bcrypt This uses Node.js crypto module to generate bcrypt hashes compatible with Caddy's basic_auth handler.
Plain text password
Bcrypt cost factor (default: 10, range: 4-31)
Promise resolving to bcrypt hash string
const hash = await hashPassword("my-secret-password");// Returns: $2a$10$... (bcrypt hash) Copy
const hash = await hashPassword("my-secret-password");// Returns: $2a$10$... (bcrypt hash)
Hash a password using bcrypt This uses Node.js crypto module to generate bcrypt hashes compatible with Caddy's basic_auth handler.