node-bcc
Version:
A simple Block Check Character library.
21 lines (20 loc) • 783 B
TypeScript
export declare class Ascii {
/**
* 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 (`0x1A`hex / `26`dec) is inserted. We
* recommend using {@link Ascii.validate} to validate the input first.
*
* @param input The string to convert.
* @returns An array that contains the character codes.
*/
static asciiToByteArray(input: string): number[];
/**
* Validates the given `input` to make sure it only contains ASCII characters.
*
* @static
* @param input The string to validate.
* @returns Whether the given string is valid.
*/
static validate(input: string): boolean;
}