Outputs a random word from the wordlist. For title case, the output can be piped to title
.
- Lowercase:
{{ word }}
- Title case:
{{ title word }}
Outputs a slice of random words from the wordlist. The output will be a slice, which can be joined using join
. For title case, the output can be piped to title
.
- Lowercase, joined with
-
:{{ words 3 | join "-" }}
- Title case, joined with
-
:{{ words 3 | join "-" | title }}
Behaves similarly to words
, but will append a random number to one of the words.
{{ wordsWithNumber 3 | join "-" }}
Alias for Sprig's randNumeric
function. A random number will be generated with the number of digits determined by the parameter.
- Generate a number from 0-9:
{{ num 1 }}
- Generate a number from 10-99:
{{ num 2 }}
Alias for Sprig's randAlpha
function. Random letters will be generated with the length determined by the parameter.
- Generate a random string of letters:
{{ alpha 32 }}
Alias for Sprig's randAlphaNum
function. Random letters and numbers will be generated with the length determined by the parameter.
- Generate a random string of letters and numbers:
{{ alphaNum 32 }}
Alias for Sprig's randAscii
function. Random letters, numbers, and symbols will be generated with the length determined by the parameter.
- Generate a random string of letters, numbers, and symbols:
{{ ascii 32 }}
Random binary data will be generated with number of bytes determined by the parameter. Useful with b64enc
.
- Generate a random base64 string with 32 bytes of data:
{{ binary 32 | b64enc }}
Randomly shuffles a slice/list.
- Shuffles a list of numbers:
{{ list 1 2 3 4 5 6 | shuffle | join "" }}