Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Base64

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

Hierarchy

  • Base64

Index

Methods

Abstract alphabet

  • alphabet(): string

decodeDigit

  • decodeDigit(c: number): number

encodeDigit

  • encodeDigit(b: number): number

Abstract isDigit

  • isDigit(c: number): boolean

Abstract isPadded

  • isPadded(): boolean
  • isPadded(isPadded: boolean): Base64

parse

  • 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>

parseUint8Array

  • 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 binds a Uint8Array array containing all parsed base-64 data.

    Parameters

    Returns Parser<Uint8Array>

parser

uint8ArrayWriter

  • uint8ArrayWriter(): Writer<Uint8Array, unknown>
  • uint8ArrayWriter(input: Uint8Array): Writer<unknown, Uint8Array>

writeQuantum

  • writeQuantum(c1: number, c2: number, c3: number, c4: number, output: Output): void
  • Decodes the base-64 digits c1, c2, c3, and c4, and writes the 8 to 24 bit quantity they represent to the given output.

    Parameters

    • c1: number
    • c2: number
    • c3: number
    • c4: number
    • output: Output

    Returns void

writeUint8Array

  • writeUint8Array(input: Uint8Array, output: Output): Writer<unknown, unknown>
  • 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

    • input: Uint8Array
    • output: Output

    Returns Writer<unknown, unknown>

Static standard

  • standard(isPadded?: boolean): Base64

Static url

  • url(isPadded?: boolean): Base64