Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Ascii

Hierarchy

  • Ascii

Index

Constructors

Methods

Constructors

constructor

Methods

Static asciiToByteArray

  • asciiToByteArray(input: string): number[]
  • Converts the given input into an array of numbers representing the characters as their decimal value. When a character that is not within the ASCII spec is encountered, a SUB (0x1Ahex / 26dec) is inserted. We recommend using Ascii.validate to validate the input first.

    Parameters

    • input: string

      The string to convert.

    Returns number[]

    An array that contains the character codes.

Static validate

  • validate(input: string): boolean
  • Validates the given input to make sure it only contains ASCII characters.

    static

    Parameters

    • input: string

      The string to validate.

    Returns boolean

    Whether the given string is valid.

Generated using TypeDoc