strRandom
Returns a random String containing numbers or uppercase and lowercase letters of the given length. A non-positive length returns an empty string.
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
| Name | Type | Required | Default |
|---|---|---|---|
length | numberint | ● | – |
additionalCharacters named keyword | stringStringstr | – | – |
namedThese parameters are passed as named parameters.
keywordThese parameters are passed as keyword arguments, or as a single dict in their place.
Returns
string
String
str
Examples
javascript
strRandom(5); // e.g. 'CHy2M'dart
strRandom(5); // e.g. 'CHy2M'python
strRandom(5) # e.g. 'CHy2M'