Skip to content

@kaelyx/ts-kit / string / RandomStringCharset

Variable: RandomStringCharset ​

const RandomStringCharset: object

Defined in: string/random-string/random-string.types.ts:14

Preset character sets for RandomStringOptions.charset. Each preset is a string, so you can join presets with + or add your own characters.

Type Declaration ​

alphanumeric ​

readonly alphanumeric: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'

Uppercase letters, lowercase letters and digits.

digits ​

readonly digits: "0123456789" = '0123456789'

0 to 9.

hex ​

readonly hex: "0123456789abcdef" = '0123456789abcdef'

0 to 9 and a to f.

lowercase ​

readonly lowercase: "abcdefghijklmnopqrstuvwxyz" = 'abcdefghijklmnopqrstuvwxyz'

a to z.

symbols ​

readonly symbols: "!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~" = '!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~'

All printable ASCII symbols.

symbolsSimple ​

readonly symbolsSimple: "-_." = '-_.'

Symbols that are safe in URLs and file names: -, _ and ..

uppercase ​

readonly uppercase: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

A to Z.

Example ​

ts
const { uppercase, digits } = RandomStringCharset
randomString({ charset: uppercase + digits })