Documentation ¶
Overview ¶
Package bitpack implements efficient bit packing and unpacking routines for integers of various bit widths.
Index ¶
Constants ¶
const PaddingInt32 = 16
PaddingInt32 is the padding expected to exist after the end of input buffers for the UnpackInt32 algorithm to avoid reading beyond the end of the input.
const PaddingInt64 = 32
PaddingInt64 is the padding expected to exist after the end of input buffers for the UnpackInt32 algorithm to avoid reading beyond the end of the input.
Variables ¶
This section is empty.
Functions ¶
func PackInt32 ¶
PackInt32 packs values from src to dst, each value is packed into the given bit width regardless of how many bits are needed to represent it.
The function panics if dst is too short to hold the bit packed values.
func PackInt64 ¶
PackInt64 packs values from src to dst, each value is packed into the given bit width regardless of how many bits are needed to represent it.
The function panics if dst is too short to hold the bit packed values.
func UnpackInt32 ¶
UnpackInt32 unpacks 32 bit integers from src to dst.
The function unpacked len(dst) integers, it panics if src is too short to contain len(dst) values of the given bit width.
func UnpackInt64 ¶
UnpackInt64 unpacks 64 bit integers from src to dst.
The function unpacked len(dst) integers, it panics if src is too short to contain len(dst) values of the given bit width.
Types ¶
This section is empty.