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.
Properties
Section titled “Properties”
readonlykind:"binary-fuse-8"|"binary-fuse-16"
Defined in: packages/static-filter/src/static-filter.ts:31
readonlysize:number
Defined in: packages/static-filter/src/static-filter.ts:33
Number of distinct keys the filter was built from. Repeated keys count once.
byteLength
Section titled “byteLength”
readonlybyteLength: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.
fingerprintBits
Section titled “fingerprintBits”
readonlyfingerprintBits:8|16
Defined in: packages/static-filter/src/static-filter.ts:37
Bits in one fingerprint.
falsePositiveRateEstimate
Section titled “falsePositiveRateEstimate”
readonlyfalsePositiveRateEstimate:number
Defined in: packages/static-filter/src/static-filter.ts:39
The theoretical false-positive rate, 2^-fingerprintBits, or 0 for an empty filter.
mightContain
Section titled “mightContain”
readonlymightContain: (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.
Parameters
Section titled “Parameters”Uint8Array
Returns
Section titled “Returns”boolean
Throws
Section titled “Throws”With INVALID_KEY when key is not a Uint8Array.