Class Base64Abstract

Base-64 (7-bit ASCII) encoding [[Parser]]/[[Writer]] factory.

Hierarchy

  • Base64

Constructors

Properties

alphabet: string

The 64 character string, where the character at index i is the encoding of the base-64 digit i.

Methods

  • Returns this Base64 encoding with required padding, if padded is true.

    Parameters

    • padded: boolean

    Returns Base64

  • Returns the 7-bit quantity represented by the base-64 digit c.

    Parameters

    • c: number

    Returns number

    Throws

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

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

    Parameters

    • b: number

    Returns number

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

    Parameters

    • c: number

    Returns boolean

  • Returns true if this base-64 encoding requires padding.

    Returns boolean

  • Parses the base-64 (7-bit ASCII) 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-64 (7-bit ASCII) 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-64 data.

    Parameters

    Returns Parser<Uint8Array>

  • Returns a Parser that decodes base-64 (7-bit ASCII) encoded input, and writes the decoded bytes to output.

    Type Parameters

    • O

    Parameters

    Returns Parser<O>

  • Returns a Writer that, when fed an input Uint8Array, returns a continuation that writes the base-64 (7-bit ASCII) encoding of the input Uint8Array.

    Returns Writer<Uint8Array, unknown>

  • Returns a Writer continuation that writes the base-64 (7-bit ASCII) encoding of the input byte array.

    Parameters

    • input: Uint8Array

    Returns Writer<unknown, Uint8Array>

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

    Type Parameters

    • T

    Parameters

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

    Returns Output<T>

    the continuation of the output.

  • Writes the base-64 (7-bit ASCII) 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 Base64 encoding with the standard alphabet, and required padding, if isPadding is true.

    Parameters

    • Optional padded: boolean

    Returns Base64

  • Returns the Base64 encoding with the url and filename safe alphabet, and required padding, if padded is true.

    Parameters

    • Optional padded: boolean

    Returns Base64

Generated using TypeDoc