Skip to content

Defined in: packages/static-filter/src/static-filter.ts:30

An immutable approximate membership filter over a set of Uint8Array keys fixed at construction.

Every key the filter was built from answers true: there are no false negatives. A key it was not built from answers true with probability about falsePositiveRateEstimate. The filter holds fingerprints only, never the keys, so it cannot list, count, or delete them; a changed key set builds a new filter.

readonly kind: "binary-fuse-8" | "binary-fuse-16"

Defined in: packages/static-filter/src/static-filter.ts:31


readonly size: number

Defined in: packages/static-filter/src/static-filter.ts:33

Number of distinct keys the filter was built from. Repeated keys count once.


readonly byteLength: number

Defined in: packages/static-filter/src/static-filter.ts:35

Bytes of the fingerprint array: one per slot for binary-fuse-8, two for binary-fuse-16, 0 when empty.


readonly fingerprintBits: 8 | 16

Defined in: packages/static-filter/src/static-filter.ts:37

Bits in one fingerprint.


readonly falsePositiveRateEstimate: number

Defined in: packages/static-filter/src/static-filter.ts:39

The theoretical false-positive rate, 2^-fingerprintBits, or 0 for an empty filter.


readonly mightContain: (key) => boolean

Defined in: packages/static-filter/src/static-filter.ts:46

Whether key may be one of the keys the filter was built from: always true for those keys, and true with probability about falsePositiveRateEstimate for any other key. Three array reads after one XXH64 hash.

Uint8Array

boolean

With INVALID_KEY when key is not a Uint8Array.