Skip to main content

max_rzcobs_encoding_length

Function max_rzcobs_encoding_length 

Source
pub const fn max_rzcobs_encoding_length(n: usize) -> usize
Expand description

Worst-case rzCOBS-encoded length for a payload of n bytes, excluding the trailing 0x00 frame delimiter.

Per Dirbaio’s analysis: at most ceil(n / 7) control bytes are emitted, plus n payload bytes, plus 1 for the final end-marker.