Tools/random/string

random/string

Generate a random string or token from a chosen character set.

Free / no pricing configured

What it does

Generates a random string of a given length from a named character set or a custom alphabet. Suitable for tokens, passwords, and identifiers.

Primary use cases

  • Generating API tokens, passwords, or nonces.
  • Producing random codes or slugs.

Good to know

length defaults to 16 (max 256). charset is one of alphanumeric (default), alphabetic, lowercase, uppercase, numeric, hex, ascii_printable. Provide alphabet to use a custom character set instead. Uses a cryptographically-strong generator. Non-deterministic.

Parameters

lengthintegeroptional

Length of the string. Defaults to 16.

charsetstringoptional

Named character set. Defaults to alphanumeric. Ignored if 'alphabet' is given.

alphabetstringoptional

Custom set of characters to draw from. Overrides 'charset'.

random/string — Faro