Skip to main content

Module hex

Module hex 

Source
Expand description

Lowercase-hex byte-emit — no_std, no_alloc.

The κ-label’s 64-byte suffix is the lowercase-hex serialization of the σ-projection’s 32-byte SHA-256 digest. This module’s encode_lower_into is the canonical emit-path; callers reach it through crate::label::AddressLabel in normal use, but it is pub so any realization wiring κ-derivation against a different hash axis (per ARCHITECTURE.md “Alternate hash axes”) reuses the same lowercase-hex discipline.

§Output discipline

Each input byte produces exactly two ASCII characters from 0123456789abcdef. Output length is always 2 × input.len(). ASCII case is canonical: the κ-label IRI’s wire-format pins lowercase hex (sha256:7a38…, not sha256:7A38…).

Structs§

HexOutputOverflow
Output-buffer-too-small error. Surfaced to callers when out cannot hold 2 × input.len() bytes.

Functions§

encode_lower_into
Emit input as lowercase ASCII hex into out. Returns the number of bytes written — always 2 × input.len() on success.