Skip to main content

Module bit_pack

Module bit_pack 

Source
Expand description

Bit packing utilities for chunk persistence.

Uses only power-of-2 bit widths (1, 2, 4, 8, 16) to avoid entries spanning u64 boundaries, which simplifies encoding/decoding and improves performance.

Functionsยง

bits_for_palette_len
Calculates the number of bits needed to represent indices into a palette. Only returns power-of-2 values: 1, 2, 4, 8, or 16.
pack_indices
Packs indices into a compact bit array using power-of-2 bit widths.
unpack_indices
Unpacks indices from a compact bit array.