Expand description
A std-only SHA-256, because the sha2 crate’s generic stack costs tens of kB.
Every download is verified with it and the cache is keyed by it.
Names inside compress follow FIPS 180-4, so the code reads against the spec.
Structs§
Constants§
- BLOCK_
SIZE 🔒 - H0 🔒
- The first 32 bits of the fractional parts of the square roots of the first 8 primes (FIPS 180-4 §5.3.3).
- K 🔒
- The first 32 bits of the fractional parts of the cube roots of the first 64 primes (FIPS 180-4 §4.2.2).
- LENGTH_
OFFSET 🔒 - Where the message length starts inside the final padded block.
Functions§
- hex
- Lowercase hex, the form the manifest and the cache use.
- hex_
digest - The lowercase hex digest of data already in memory.
- hex_
digest_ of_ file - The lowercase hex digest of a file, read in chunks rather than whole.