Skip to main content

Module chunks

Module chunks 

Source
Expand description

Fixed-size plaintext chunks and bounded reconstruction of individual frames.

Structs§

FrameDecoder
Holds only one unfinished frame. A known remaining length lets the write decoder refuse a frame that crosses its part’s end before reserving memory.
PlaintextChunks
Cut a sequence of bounded byte pieces into fixed-size chunks, retaining at most one frame and one output chunk. Only the last chunk may be shorter than CHUNK_SIZE.

Constants§

CHUNK_SIZE
Plaintext bytes in a full file, write-part or snapshot chunk.

Functions§

chunk_count
How many chunks length plaintext bytes cut into; none when empty.
chunk_length
The plaintext length of chunk index of length bytes: full, except a shorter last chunk. The caller keeps index below the chunk count.
chunk_start
Where chunk index begins in the plaintext.