Skip to main content

Module reconstruction

Module reconstruction 

Source
Expand description

K-of-N shard reassembly with manifest verification.

Pure domain logic — no I/O, no file system, no async runtime.

Functions§

arrange_shards
Reorder extracted shard data into shard slots based on embedded index.
count_present
Count how many shards are present (non-None) in a slot array.
deserialize_shard
Deserialize a shard from binary produced by serialize_shard.
serialize_shard
Serialize a shard to binary: [index:1][total:1][hmac:32][data_len:4][data:N].
validate_shard_count
Validate that enough shards are present for reconstruction.