Skip to main content

reassemble

Function reassemble 

Source
pub fn reassemble(strings: &[&str]) -> Result<Descriptor, Error>
Expand description

Reassemble a Descriptor from N md1 codex32 strings.

Algorithm:

  1. Unwrap each string via the codex32 layer (verifies BCH per chunk).
  2. Parse the 37-bit chunk header from each.
  3. Validate consistency: same version, chunk_set_id, count.
  4. Sort by index; verify 0..count-1 with no gaps.
  5. Concatenate per-chunk payload bytes.
  6. Decode the reassembled payload via decode_payload.
  7. Verify the reassembled payload’s derived chunk-set-id matches the chunk-set-id present in every chunk header (cross-chunk integrity).