@micham/iso8583
    Preparing search index...

    Type Alias Codec<T>

    A codec defines a bi-directional mapping between a binary representation (in the form of a Buffer) and a logical representation (in some other type). The codec is responsible for encoding instances of the logical type to Buffers, and decoding Buffers to instances of the logical type.

    type Codec<T = string> = {
        decode: (input: Buffer) => T;
        encode: (input: T) => Buffer;
        name: string;
    }

    Type Parameters

    • T = string

      The logical type of the codec

    Index

    Properties

    Properties

    decode: (input: Buffer) => T

    Decode a binary representation into an instance of the logical type

    encode: (input: T) => Buffer

    Encode an instance of the logical type into a binary representation

    name: string

    The name of the codec