• Creates a field factory for fields that store packed values (i.e., where the value is stored in half-bytes instead of full bytes).

    Returns

    A field factory function that creates fields with the specified codec and padding function.

    Type Parameters

    • T

    Parameters

    • codec: Codec<T>

      The codec used to encode/decode the value.

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

      A function used to pad the encoded value if necessary.

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

          • x: Buffer
          • length: number

          Returns Buffer

    Returns FieldFactory<T>

Generated using TypeDoc