Expand description
Content integrity verification via SHA-256.
Provides streaming hash computation for files and in-memory data, plus constant-time hash comparison for verification.
Structs§
- Streaming
Hasher - Streaming hash verifier for chunked data reception.
Constants§
- HASH_
HEX_ LEN - Size of a SHA-256 hex string.
- HASH_
LEN - Size of a SHA-256 hash in bytes.
Functions§
- hash_
bytes - Compute the SHA-256 hash of an in-memory byte slice as a hex string.
- hash_
bytes_ raw - Compute the raw SHA-256 hash of an in-memory byte slice.
- hash_
file - Compute the SHA-256 hash of a file as a hex string.
- hash_
reader - Compute the SHA-256 hash of data from any reader as a hex string.
- verify_
file_ hash - Verify that a file’s hash matches an expected hex string.
- verify_
hash - Verify that a byte slice’s hash matches an expected hex string.