Random

The Random class provides 256-bit seedable, deterministic, and secure random number generators, based on the ChaCha20 algorithm (e.g. Rust's StdRng).

By default the seed is based on the system clock.

let rng be new Sparkle's Random

Constructor

Returns a new Random with the given seed, or based on the system clock if blank.

let rng be new Sparkle's Random with just "the best seed"

Methods

Returns a newly generated number between 0 and 1.

let n be do rng's random

Returns a newly generated integer between min and max, inclusive.

let n be rng's random_integer with 1, and 6
print "hello world"