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

Random_Provider

Random_Provider

Random_Provider -- 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 Random_Provider 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 'Random_Provider' before 'get' can be
used to obtain the new random number.
Return the random number stored in this instance of Random_Provider, 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 Random_Provider containing a new state. Depending
on the qualifity of this random number generator, this might be a simple
function of the original Random_Provider or it might use an external source
of entropy to create a new instance.