An object that can encode and decode a value to and from a Uint8Array. It supports encoding looser types than it decodes for convenience. For example, a bigint encoder will always decode to a bigint but can be used to encode a number.
Uint8Array
bigint
number
The type of the value to encode.
The type of the decoded value. Defaults to TFrom.
TFrom
An object that can encode and decode a value to and from a
Uint8Array. It supports encoding looser types than it decodes for convenience. For example, abigintencoder will always decode to abigintbut can be used to encode anumber.