Module hash

Module hash 

Source
Expand description

Password hashing, keyed authentication, and digest helpers.

Passwords are hashed with an explicit Argon2id policy and a fresh salt for storage. Stored PHC strings are checked against finite verification limits before Argon2 allocates its work memory. SHA-256 helpers cover deterministic digest cases, while HMAC-SHA-256 covers keyed cache and lookup components that must not expose a fast, reusable digest of a low-entropy secret.

Structs§

PasswordHashPolicy
Password hashing and verification policy.
PasswordHashVerification
Detailed result of password verification.
PasswordHashVerificationLimits
Absolute resource limits accepted when verifying a stored Argon2id PHC string.
PasswordHashWorkFactor
Argon2id work factor used when creating new password hashes.

Functions§

bytes_to_hex
Encodes arbitrary bytes as lowercase hex.
hash_password
Hashes a password with the default RFC 9106 second recommended policy.
hash_password_with_policy
Hashes a password with an explicit policy and a fresh random salt.
hmac_sha256_hex
Computes HMAC-SHA-256 over data and returns lowercase hex.
new_sha256
Creates a new incremental SHA-256 hasher.
sha256_digest_to_hex
Encodes a SHA-256 digest as lowercase hex.
sha256_hex
Computes the SHA-256 digest of data and returns lowercase hex.
verify_password
Verifies a password with the default policy.
verify_password_with_policy
Verifies a password with an explicit policy and reports whether a matching hash needs upgrade.