• Base function for creating field factories that parse and prepare binary data with a given codec.

    Returns

    A factory for creating fields that parse and prepare binary data with the given codec.

    Type Parameters

    • T

      The type of the field's value.

    Parameters

    • codec: Codec<T>

      A codec for encoding and decoding binary data to and from values of type T.

    • Optional padding: ((x: Buffer, length: number) => Buffer)

      A function for padding binary data to a given length.

        • (x: Buffer, length: number): Buffer
        • Parameters

          • x: Buffer
          • length: number

          Returns Buffer

    Returns FieldFactory<T>

Generated using TypeDoc