Skip to main content

Module chunk

Module chunk 

Source
Expand description

Stream chunking + cross-chunk integrity hash for mk1 multi-string cards.

Per design/SPEC_mk_v0_1.md §2.6, the canonical bytecode is suffixed with a 4-byte cross_chunk_hash (= SHA-256(canonical_bytecode)[0..4]) before splitting into chunk fragments; the hash is verified at reassembly. This catches dropped, reordered, or substituted chunks that the per-chunk BCH layer alone cannot detect.

Structs§

ChunkFragment
One chunk’s worth of split output: a parsed header + its fragment bytes.

Constants§

MAX_CHUNKABLE_BYTECODE
Maximum canonical-bytecode length that can be chunked under v0.1.

Functions§

reassemble_from_chunks
Reassemble canonical bytecode from a list of parsed chunks.
split_into_chunks
Split canonical bytecode into chunks, appending the cross-chunk integrity hash.