Skip to content

serializeBitset(set, options?): Uint8Array

Defined in: packages/bitset/src/serialization.ts:123

Serialize a bitset into canonical binary bytes that restore the same layout.

The payload is the Roaring format’s no-run layout — sorted chunk keys, a cardinality per chunk, then each chunk as a sorted 16-bit id run or a bitmap — inside a knotkit/wire envelope. The bytes are Knotkit’s own framing and are not RoaringFormatSpec-compatible.

Bitset

SerializeBitsetOptions

Uint8Array

With code FOREIGN_BITSET when set was not produced by this package, or SERIALIZATION_LIMIT_EXCEEDED when a dense bitset’s bitmap would exceed BITSET_MAX_DECODE_DENSE_BYTES.