doc/functions/random.rst
randomThe random function returns a random value depending on the supplied
parameter type:
.. caution::
The ``random`` function does not produce cryptographically secure random numbers.
Do not use them for purposes that require returned values to be unguessable.
.. code-block:: twig
{{ random(['apple', 'orange', 'citrus']) }} {# example output: orange #}
{{ random('ABC') }} {# example output: C #}
{{ random() }} {# example output: 15386094 (works as the native PHP mt_rand function) #}
{{ random(5) }} {# example output: 3 #}
{{ random(50, 100) }} {# example output: 63 #}
values: The valuesmax: The max value when values is an integer