Class Base16

Base-16 (hexadecimal) encoding [[Parser]]/[[Writer]] factory.

Hierarchy

  • Base16

Constructors

  • Parameters

    • alphabet: string

    Returns Base16

Properties

alphabet: string

Returns a 16 character string, where the character at index i is the encoding of the base-16 digit i.

Accessors

  • get lowercase(): Base16
  • Returns the Base16 encoding with lowercase alphanumeric digits.

    Returns Base16

  • get uppercase(): Base16
  • Returns the Base16 encoding with uppercase alphanumeric digits.

    Returns Base16

Methods

  • Returns the Unicode code point of the base-16 digit that encodes the given 4-bit quantity.

    Parameters

    • b: number

    Returns number

  • Returns a Writer that, when fed an input Uint8Array, returns a continuation that writes the base-16 (hexadecimal) encoding of the input byte array.

    Returns Writer<Uint8Array, unknown>

  • Returns a Writer continuation that writes the base-16 (hexadecimal) encoding of the input Uint8Array.

    Parameters

    • input: Uint8Array

    Returns Writer<unknown, Uint8Array>

  • Parameters

    • output: Output<unknown>
    • input: number
    • Optional width: number

    Returns Writer<unknown, unknown>

  • Parameters

    • output: Output<unknown>
    • input: number
    • Optional width: number

    Returns Writer<unknown, unknown>

  • Writes the base-16 (hexadecimal) encoding of the input Uint8Array to the output, returning a Writer continuation that knows how to write any remaining output that couldn't be immediately generated.

    Parameters

    • output: Output<unknown>
    • input: Uint8Array

    Returns Writer<unknown, unknown>

  • Returns the 4-bit quantity represented by the base-16 digit c.

    Parameters

    • c: number

    Returns number

    Throws

    Error if c is not a valid base-16 digit.

  • Returns true if the Unicode code point c is a valid base-16 digit.

    Parameters

    • c: number

    Returns boolean

  • Parses the base-16 (hexadecimal) encoded input, and writes the decoded bytes to output, returning a Parser continuation that knows how to parse any additional input.

    Type Parameters

    • O

    Parameters

    Returns Parser<O>

  • Parses the base-16 (hexadecimal) encoded input, and writes the decoded bytes to a growable array, returning a Parser continuation that knows how to parse any additional input. The returned Parser [[Parser.bind binds]] a Uint8Array array containing all parsed base-16 data.

    Parameters

    Returns Parser<Uint8Array>

  • Returns a Parser that decodes base-16 (hexadecimal) encoded input, and writes the decoded bytes to output.

    Type Parameters

    • O

    Parameters

    Returns Parser<O>

  • Decodes the base-16 digits c1 and c2, and writes the 8-bit quantity they represent to the given output.

    Type Parameters

    • T

    Parameters

    • output: Output<T>
    • c1: number
    • c2: number

    Returns Output<T>

    the continuation of the output.

Generated using TypeDoc