Expand description
String layer — KeyCard ↔ Vec<String> (BCH + chunked-header reassembly).
Wraps the bytecode-layer codec (crate::bytecode) with the
BIP 93–derived BCH error-correction layer (forked from md-codec per
design/DECISIONS.md D-13) and the closure-locked string-layer header
structure (per Q-5 — 2-symbol single-string + 8-symbol chunked).
Submodules:
bch: BCH polymod, syndrome decoder, and bech32-alphabet helpers.- [
bch_decode]: syndrome-based BM/Forney decoder (impl detail ofbch).pub(crate)for cross-module test fixture access; not part of the user-facing API. header: 5-bit-symbol-alignedStringLayerHeader(SingleString+Chunkedvariants).chunk: stream split + reassemble withcross_chunk_hashintegrity check.
The public entry points wired up here (encode / encode_with_chunk_set_id
/ decode) are the layer-3 boundary; crate::key_card re-exports them.
Re-exports§
pub use bch::ALPHABET;pub use bch::BchCode;pub use bch::CaseStatus;pub use bch::CorrectionResult;pub use bch::DecodedString;pub use bch::SEPARATOR;pub use bch::bch_correct_long;pub use bch::bch_correct_regular;pub use bch::bch_create_checksum_long;pub use bch::bch_create_checksum_regular;pub use bch::bch_verify_long;pub use bch::bch_verify_regular;pub use bch::bytes_to_5bit;pub use bch::case_check;pub use bch::decode_string;pub use bch::encode_5bit_to_string;pub use bch::five_bit_to_bytes;pub use bch::hrp_expand;pub use chunk::reassemble_from_chunks;pub use chunk::split_into_chunks;pub use header::StringLayerHeader;
Modules§
- bch
- BCH primitives for the mk1 string layer: bech32 alphabet conversion and syndrome-based error correction.
- chunk
- Stream chunking + cross-chunk integrity hash for mk1 multi-string cards.
- header
- 5-bit-symbol-aligned string-layer header (single-string + chunked variants).
Functions§
- decode
- Decode one or more
mk1-prefixed strings into aKeyCard. - encode
- Encode a
KeyCardinto one or moremk1-prefixed strings. - encode_
with_ chunk_ set_ id - Like
encode, but with an explicitchunk_set_idoverride.