Skip to main content

Module decode

Module decode 

Source
Expand description

Public decoder. Applies SPEC §4 validity rules in order.

v0.2.0: also hosts decode_with_correction — the BCH-error-correcting decode entry point per plan §1 D22 + §2.B.2. Parse → polymod-residue → (if non-zero) call crate::bch_decode::decode_regular_errors → apply corrections → run the existing decode path → return (Tag, Payload, Vec<CorrectionDetail>). ms1 is single-chunk per codex32 spec, so there is no atomic-multi-chunk variant (cf. md-codec’s per-chunk-set version).

Structs§

CorrectionDetail
Per-correction report emitted by decode_with_correction. One entry per repaired character. position is 0-indexed into the codex32 data-part (i.e. the characters following the ms1 HRP + separator); was is the original (corrupted) char from the input; now is the corrected char.

Functions§

decode
Decode a v0.1 ms1 string into (Tag, Payload).
decode_with_correction
BCH-error-correcting decode for a single ms1 string.