interface Codec {
    decode: (data: string | BufferSource) => Uint8Array;
    encode: (data: string | BufferSource, pad?: boolean) => string;
}

Properties

Properties

decode: (data: string | BufferSource) => Uint8Array
encode: (data: string | BufferSource, pad?: boolean) => string

Encode bytes or utf8 string to string

Type declaration

    • (data: string | BufferSource, pad?: boolean): string
    • Parameters

      • data: string | BufferSource

        Data to be encoded to string

      • Optionalpad: boolean

        Should have padding. Defaults: true

      Returns string