MedallionRandom
Contains helpers and extensions for working with random number generators
Returns a random boolean value
Returns a random 32-bit integer
Returns a random 64-bit integer
Returns a random value in [0, 1)
Returns the sequence of values that would be generated by repeated
calls to
Returns true with probability
Returns the sequence of bytes that would be returned by repeated calls
to
Returns randomly shuffled using
or else .
This method performs a lazy "streaming" shuffle: when the first
element of the returned is requested, the
entire sequence is enumerated. The
is then used lazily to shuffle the next element into place as the result
sequence is enumerated
Shuffles the given using
if provided or else
Returns a normally-distributed double value with mean 0 and standard deviation 1
Returns a random double value uniformly in [0, ). The underlying randomness is
provided by , which may be unsuitable for very large ranges
Returns a random double value uniformly in [, ). The
underlying randomness is provided by , which may be unsuitable for
very large ranges
Returns a thread-safe instance which can be used
for static random calls
Returns a double value in [0, 1)
Returns an int value in [, )
Comparable to `new Random()`

, but seeds the with
a time-dependent value that will still vary greatly across calls to .
This avoids the problem of many s created close together being seeded
with the same value
Creates a that uses the same algorithm as the JRE. The
is seeded with a time-dependent value which will vary greatly even across close-together calls to
Creates a which replicates the same random sequence as is produced by
the standard random number generator in the JRE using the same
Returns a instance which uses the given
as a source of randomness