# serializeStaticFilter

> **serializeStaticFilter**(`filter`, `options?`): `Uint8Array`

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

Serialize a filter into binary bytes that restore the same answers for every key.

Writes the XXH64 seed, the attempt seed that peeled, the key count, the segment geometry, and the fingerprint array inside a `knotkit/wire` envelope with a producer version. Runs in O(byteLength). Two filters built from the same key set and seed serialize to identical bytes, whatever order or repetition the keys arrived in.

## Parameters

### filter

[`StaticFilter`](/reference/knotkit/static-filter/interfaces/staticfilter/)

### options?

[`SerializeStaticFilterOptions`](/reference/knotkit/static-filter/wire/interfaces/serializestaticfilteroptions/)

## Returns

`Uint8Array`

## Throws

With `FOREIGN_STATIC_FILTER` when `filter` was not produced by this package, or `MAX_CAPACITY_EXCEEDED` when the runtime cannot allocate the artifact.
