Skip to main content

Module hash

Module hash 

Source
Expand description

Password hashing and digest helpers.

Passwords are hashed with Argon2 and a fresh salt for storage, while SHA-256 helpers cover the deterministic digest cases used by services. The module keeps formatting helpers centralized so hex output stays lowercase and stable across call sites.

Functionsยง

bytes_to_hex
Encodes arbitrary bytes as lowercase hex.
hash_password
Hashes a password with Argon2 and a fresh random salt.
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 against a stored Argon2 password hash.