# StaticFilter

Defined in: [packages/static-filter/src/static-filter.ts:30](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/static-filter/src/static-filter.ts#L30)

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

### kind

> `readonly` **kind**: `"binary-fuse-8"` | `"binary-fuse-16"`

Defined in: [packages/static-filter/src/static-filter.ts:31](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/static-filter/src/static-filter.ts#L31)

***

### size

> `readonly` **size**: `number`

Defined in: [packages/static-filter/src/static-filter.ts:33](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/static-filter/src/static-filter.ts#L33)

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

***

### byteLength

> `readonly` **byteLength**: `number`

Defined in: [packages/static-filter/src/static-filter.ts:35](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/static-filter/src/static-filter.ts#L35)

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

***

### fingerprintBits

> `readonly` **fingerprintBits**: `8` | `16`

Defined in: [packages/static-filter/src/static-filter.ts:37](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/static-filter/src/static-filter.ts#L37)

Bits in one fingerprint.

***

### falsePositiveRateEstimate

> `readonly` **falsePositiveRateEstimate**: `number`

Defined in: [packages/static-filter/src/static-filter.ts:39](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/static-filter/src/static-filter.ts#L39)

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

***

### mightContain

> `readonly` **mightContain**: (`key`) => `boolean`

Defined in: [packages/static-filter/src/static-filter.ts:46](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/static-filter/src/static-filter.ts#L46)

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

##### key

`Uint8Array`

#### Returns

`boolean`

#### Throws

With `INVALID_KEY` when `key` is not a `Uint8Array`.
