Skip to main content

Module bool_bitpack

Module bool_bitpack 

Source
Expand description

Boolean bitpacking (encoding id 9).

Values must be 0 or 1; each becomes one bit, LSB first within a byte. Layout: count: u32 LE, then ceil(count / 8) packed bytes. The cascade only offers this encoding when the whole input is binary, so the encoder asserts that instead of masking, which would break the roundtrip silently.

Functionsยง

decode
Decodes an encoded buffer, appending at most max_values values to out. The count is a claim until checked against the ceiling.
encode
Encodes values into out, returning the encoded byte length. Every value must be 0 or 1.