This is the documentation for the development version. There are no official binaries for it; build it from the source code in git. Download links on these pages work only after the release. For the current release, see version 7.0.

Math::Random

Math::Random(minValue, maxValue): int

Generate pseudo random number in given range. Uses cryptographically secure pseudo random generator (CSPRNG).

Table 1. Parameters

minValue

int

Start of range (inclusive)

maxValue

int

End of range (inclusive)

Return

Random value in range minValue..maxValue.

println(Math::Random(0, 100)); // Will print random value in 0..100 range