utils/alphanumeric
Documentation
- source: utils/alphanumeric.ts
Overview
Classes
Alphanumeric
toAlphanumeric()
tsstatic toAlphanumeric(string: string): string;
Parameter Type Description stringstringReturns
- Type:
string- Description:
randomString()
Generates a random alphanumeric sequence with the specified length
tsstatic randomString(length: number, charset: string): string;
Parameter Type Description lengthnumber{Integer} Defaults to 4 charsetstringReturns
- Type:
string- Description:
alphanumeric()
Generates a random alphanumeric sequence with the specified length
tsstatic alphanumeric(length: number, lowercase: boolean): string;
Parameter Type Description lengthnumber{Integer} Defaults to 4 lowercaseboolean{Boolean} Defaults to true Returns
- Type:
string- Description:
alpha()
Generates a random ASCII sequence with the specified length
tsstatic alpha(length: number, lowercase: boolean): string;
Parameter Type Description lengthnumber{Integer} Defaults to 4 lowercaseboolean{Boolean} Defaults to true Returns
- Type:
string- Description:
numeric()
Generates a random numeric value
tsstatic numeric(length: number): string;
Parameter Type Description lengthnumber{Integer} Defaults to 4 Returns
- Type:
string- Description:
isNumeric()
Tests is the provided `str` argument is a valid numeric sequence.
tsstatic isNumeric(str: string): boolean;
Parameter Type Description strstring{String} the string to test Returns
- Type:
boolean- Description:
isAlphanumeric()
Tests is the provided `str` argument is a valid alphanumeric sequence.
tsstatic isAlphanumeric(str: string): boolean;
Parameter Type Description strstring{String} the string to test Returns
- Type:
boolean- Description:
