Skip to content

strRandom

Returns a random String containing numbers or uppercase and lowercase letters of the given length. The default return length is 12.

The random strings generated by this function do not guarantee uniqueness and should not be used to generate unique IDs or for security operations.

Parameters

  • length::number
  • additionalCharacters::string?
    Named

Returns

string

Examples

javascript
strRandom(5); // Returns 'CHy2M'
dart
strRandom(5); // Returns 'CHy2M'

Released under the MIT License