= %randstr( <format> )

Get random string built from input character classes.

.Return: _string_

Build strings of random chars, useful for generating tokens and passcodes
Format similar to the Perl module `String::Random`.

Format characters may include the following, and may be
preceded by an integer repetition count:

.Character Classes
[options="header"]
[cols="30%,70%"]
|=====
| Character | Description
| c         | lowercase letters `[a-z]`
| C         | uppercase letters `[A-Z]`
| n         | numbers `[0-9]`
| a         | alphanumeric
| !         | punctuation `!"#$%&'()*+,-./:;<=>?@[\\]^_{\|}~``
| .         | alphanumeric + punctuation
| s         | alphanumeric + `.` and `/`
| o         | characters suitable for OTP (visually similar characters removed)
| b         | binary data
|=====

There is no `h` for "hex".  Instead, use `b` to create binary data, followed by the `%hex(..)` function to convert it to hex.

.Example

[source,unlang]
----
&reply.Reply-Message := "The random string output is %randstr(8a)"
----

.Output

```
The random string output is 4Uq0gPyG
```

// Copyright (C) 2023 Network RADIUS SAS.  Licenced under CC-by-NC 4.0.
// This documentation was developed by Network RADIUS SAS.
