Skip to content

utils/alphanumeric

Documentation

Overview

Classes

Alphanumeric

toAlphanumeric()

ts
static toAlphanumeric(string: string): string;
ParameterTypeDescription
stringstring

Returns

  • Type: string
  • Description:

randomString()

Generates a random alphanumeric sequence with the specified length

ts
static randomString(length: number, charset: string): string;
ParameterTypeDescription
lengthnumber{Integer} Defaults to 4
charsetstring

Returns

  • Type: string
  • Description:

alphanumeric()

Generates a random alphanumeric sequence with the specified length

ts
static alphanumeric(length: number, lowercase: boolean): string;
ParameterTypeDescription
lengthnumber{Integer} Defaults to 4
lowercaseboolean{Boolean} Defaults to true

Returns

  • Type: string
  • Description:

alpha()

Generates a random ASCII sequence with the specified length

ts
static alpha(length: number, lowercase: boolean): string;
ParameterTypeDescription
lengthnumber{Integer} Defaults to 4
lowercaseboolean{Boolean} Defaults to true

Returns

  • Type: string
  • Description:

numeric()

Generates a random numeric value

ts
static numeric(length: number): string;
ParameterTypeDescription
lengthnumber{Integer} Defaults to 4

Returns

  • Type: string
  • Description:

isNumeric()

Tests is the provided `str` argument is a valid numeric sequence.

ts
static isNumeric(str: string): boolean;
ParameterTypeDescription
strstring{String} the string to test

Returns

  • Type: boolean
  • Description:

isAlphanumeric()

Tests is the provided `str` argument is a valid alphanumeric sequence.

ts
static isAlphanumeric(str: string): boolean;
ParameterTypeDescription
strstring{String} the string to test

Returns

  • Type: boolean
  • Description: