Fuzion Logo
flang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.



randomProvider -- abstract source of random numbers

This provides the random number input to be used by the 'random' effect.
Implementation may be dumb sequences of pseudo-random numbers or high-qualiity
cryptographic random number generators

A randomProvider contains an immutable state, repeated calls to 'get' result
in the same value. To produce a sequence of different random numbers, 'next'
must be used to create a new instance of 'randomProvider' before 'get' can be
used to obtain the new random number.

Return the random number stored in this instance of randomProvider, in the
range 0..u64.max

NOTE: this feature is pure, i.e., repeated calls on the same target result
in equal results. Use 'next' to get different results.

create a new instance of randomProvider containing a new state. Depending
on the qualifity of this random number generator, this might be a simple
function of the original randomProvider or it might use an external source
of entropy to create a new instance.