Skip to content

binaryFuse8StaticFilter(keys, options?): StaticFilter

Defined in: packages/static-filter/src/binary-fuse-8-static-filter.ts:17

Build an immutable binary-fuse-8 filter from a known set of keys: one byte per slot, about 9 to 10 bits per key, and a false-positive rate near 2^-8 (0.39%).

Every key is hashed with XXH64 under seed, repeated hashes are dropped, and the rest are placed by peeling a 3-wise Binary Fuse hypergraph (Graf and Lemire, 2022). A probe reads three slots in three adjacent segments. Builds in expected O(n) time after hashing n inputs, with O(d) temporary storage for d distinct hashes.

Iterable<Uint8Array<ArrayBufferLike>>

StaticFilterOptions

StaticFilter

With INVALID_KEYS when keys is not iterable, INVALID_KEY when a key is not a Uint8Array, INVALID_SEED when seed is not an unsigned 64-bit bigint, MAX_CAPACITY_EXCEEDED past 2^30 distinct keys or when the runtime refuses the allocation, and CONSTRUCTION_FAILED when 100 attempts all fail to peel, which a set of distinct hashes does not reach in practice.