# serializeSnapshotSet

> **serializeSnapshotSet**<`T`>(`set`, `codec`, `options?`): `Uint8Array`

Defined in: [packages/snapshot-set/src/serialization/binary.ts:91](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/snapshot-set/src/serialization/binary.ts#L91)

Serialize exact snapshot identity, version, value order, and toggle history into canonical binary bytes.

## Type Parameters

### T

`T`

## Parameters

### set

[`SnapshotSet`](/reference/knotkit/snapshot-set/interfaces/snapshotset/)<`T`>

### codec

[`ElementCodec`](/reference/knotkit/wire/interfaces/elementcodec/)<`T`>

### options?

[`SerializeSnapshotSetOptions`](/reference/knotkit/snapshot-set/wire/interfaces/serializesnapshotsetoptions/)

## Returns

`Uint8Array`

## Throws

With `MISSING_ELEMENT_CODEC`, `INVALID_CODEC_RESULT`, `NON_INJECTIVE_CODEC`, or `SERIALIZATION_LIMIT_EXCEEDED` when the state cannot be represented safely.
