Seed

sealed abstract class Seed extends Serializable

Simple RNG by Bob Jenkins:

Companion
object
trait Serializable
class Object
trait Matchable
class Any

Value members

Concrete methods

def double: (Double, Seed)

Generates a Double value.

Generates a Double value.

The values will be uniformly distributed, and will be contained in the interval [0.0, 1.0).

def long: (Long, Seed)

Generates a Long value.

Generates a Long value.

The values will be uniformly distributed.

def next: Seed

Generate the next seed in the RNG's sequence.

Generate the next seed in the RNG's sequence.

def reseed(n: Long): Seed

Reseed the RNG using the given Long value.

Reseed the RNG using the given Long value.

def slide: Seed

This is a quick way of deterministically sliding this RNG to a different part of the PRNG sequence.

This is a quick way of deterministically sliding this RNG to a different part of the PRNG sequence.

We use this as an easy way to "split" the RNG off into a new part of the sequence. We want to do this in situations where we've already called .next several times, and we want to avoid repeating those numbers while preserving determinism.

def toBase64: String

Generate a Base-64 representation of this seed.

Generate a Base-64 representation of this seed.

Given a seed, this method will return a String with 44 characters, according to the web-safe Base-64 specification (i.e. using minus (-) and underscore (_) in addition to alphanumeric characters).

The 256-bit seed is serialized as a little-endian array of 64-bit Long values. Strings produced by this method are guaranteed to be parseable by the Seed.fromBase64 method.