Expand description
Value hashing implementations.
Provides a single configurable Argon2id password hashing service with security‑first defaults.
Build mode defaults:
- Release builds (
debug_assertionsdisabled): HighSecurity preset - Debug builds (
debug_assertionsenabled): DevFast preset (faster local iteration)
You can override the default explicitly with presets or a custom configuration.
§Example
use axum_gate::hashing::argon2::Argon2Hasher;
use axum_gate::hashing::HashingService;
// Default (build‑mode appropriate) hasher
let hasher = Argon2Hasher::new_recommended().unwrap();
let hash = hasher.hash_value("secret").unwrap();
assert!(hasher.verify_value("secret", &hash).is_ok());⚠ The DevFast preset MUST NOT be used in production; it exists only to keep debug builds
responsive. When you explicitly construct a hasher, choose an appropriate security profile.
Structs§
- Argon2
Config - Argon2 parameter configuration (memory in KiB).
- Argon2
Hasher - Configurable Argon2id hasher.
Enums§
- Argon2
Preset - Preset selector for convenience.