BaseEncoder: {
    encode: (value: TFrom) => ReadonlyUint8Array;
    write: (value: TFrom, bytes: Uint8Array, offset: Offset) => Offset;
}

Type Parameters

  • TFrom

Type declaration

  • Readonlyencode: (value: TFrom) => ReadonlyUint8Array

    Encode the provided value and return the encoded bytes directly.

  • Readonlywrite: (value: TFrom, bytes: Uint8Array, offset: Offset) => Offset

    Writes the encoded value into the provided byte array at the given offset. Returns the offset of the next byte after the encoded value.