# deserializeStaticFilter

> **deserializeStaticFilter**(`bytes`): [`StaticFilter`](/reference/knotkit/static-filter/interfaces/staticfilter/)

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

Decode bytes written by [serializeStaticFilter](/reference/knotkit/static-filter/wire/functions/serializestaticfilter/).

The payload is validated before a filter is returned, in O(byte length): a parameters section of exactly 28 bytes, a key count of at most 2^30, a segment length that is a power of two in `[4, 2^18]`, a segment count length that is a positive multiple of it, at least one slot per key, a fingerprint section of exactly one or two bytes per slot, an attempt seed that one of the first 100 construction attempts under the seed draws, and, for an empty filter, no slots at all. Fingerprint values cannot be checked without the keys; pass `{ integrity: true }` when serializing to catch accidental corruption. The filter owns a copy of the bytes.

## Parameters

### bytes

`Uint8Array`

## Returns

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

## Throws

With `CORRUPT_FILTER_PAYLOAD` when the payload breaks one of those rules, `INVALID_PACKAGE_HEADER` for a malformed header, `UNKNOWN_KIND` for a kind tag this release does not read, or a shared wire code from `STATIC_FILTER_PARSE_ERROR_CODES` for a malformed envelope.
