Interface Codec<T>

interface Codec<T> {
    decode(a: Uint8Array): T;
    encode(d: T): Uint8Array;
}

Type Parameters

  • T

Methods

Methods

  • Decode an Uint8Array from a message payload into a T

    Parameters

    • a: Uint8Array

    Returns T

  • Encode T to an Uint8Array suitable for including in a message payload.

    Parameters

    Returns Uint8Array