Skip to content

roaringBitset(options?): Bitset

Defined in: packages/bitset/src/roaring-bitset.ts:25

A bitset of unsigned 32-bit ids over 65,536-id chunks, each a sorted id array or an 8 KB bitmap.

This is the recommended layout: memory follows the ids actually stored, so a caller that does not yet know how far its ids range does not pay for the span. Chunked containers also make isDisjointFrom and intersectionSize stop at the first chunk that decides them.

BitsetOptions

Optional items, added as if by add.

Bitset

With code INVALID_ID when an item is not in 0 … BITSET_MAX_ID.

const seen = roaringBitset({ items: [3, 65_536] })
seen.has(3) // true
seen.size // 2