Expand description
crate::hash — the pluggable σ-axis hash family (wiki ADR-007 /
ADR-010: the substrate ships no hasher; the application selects one).
UOR-ADDR’s κ-label is <algorithm>:<lowercase-hex-digest>. The
algorithm is the realization’s selected σ-axis H; ψ₉ folds the
canonical carrier through H and formats the label
(crate::resolvers). AddrHash is the fingerprint-width-erased
façade over a concrete prism Hasher: it carries the wire prefix
("sha256", "blake3", …), the digest width, and a digest_carrier
method that folds the (streamed) carrier through the axis and returns
the digest in a fixed MAX_DIGEST_BYTES buffer.
Erasing the Hasher<FP_MAX> const-generic into the AddrHash method
is what lets the single AddressResolverTuple
carry both the 32-byte axes and the 64-byte Sha512Hasher without a
free FP_MAX parameter (which would be unconstrained — E0207 — in the
tuple’s Has*Resolver impls). The model still binds the concrete
Hasher<FP_MAX> as its σ-axis, so the foundation pipeline computes the
full-width content fingerprint.
§Admissible axes
foundation 0.5.2 generalized the resolver tower over FP_MAX, so every
prism hasher is admissible:
| axis | LABEL_PREFIX | OUTPUT_BYTES | LABEL_BYTES | authority |
|---|---|---|---|---|
Sha256Hasher | sha256 | 32 | 71 | FIPS 180-4 §6.2 |
Blake3Hasher | blake3 | 32 | 71 | BLAKE3 §2 (the reference spec) |
Sha3_256Hasher | sha3-256 | 32 | 73 | FIPS 202 §6.1 |
Keccak256Hasher | keccak256 | 32 | 74 | Keccak SHA-3 submission (pre-FIPS padding) |
Sha512Hasher | sha512 | 64 | 135 | FIPS 180-4 §6.4 |
Constants§
- MAX_
DIGEST_ BYTES - The widest admissible digest (
Sha512Hasher= 64 bytes). EveryAddrHash::digest_carrierreturns a buffer of this width; the firstOUTPUT_BYTESare significant. - MAX_
LABEL_ BYTES - The widest admissible κ-label (
sha512:+ 128 hex = 135). The κ-label formatter (crate::resolvers) sizes its stack scratch to this and writes the active axis’sLABEL_BYTESprefix.
Traits§
- Addr
Hash - A prism hasher usable as a UOR-ADDR σ-axis. Fingerprint-width-erased:
the κ-label prefix + digest width are associated consts, and
digest_carrierfolds the carrier through the concreteHasher<FP_MAX>internally.
Functions§
- label_
bytes - The κ-label ASCII byte width for a
<prefix>:<hex>label over adigest_bytes-wide digest:prefix.len() + 1 (':') + 2 × digest_bytes.