abstract class util::Random

sys::Obj
  util::Random

@Js

Source

Random provides different implementation of random number generators with more flexibility than the methods available in sys. Also see Int.random, Float.random, Range.random, and List.random.

makeSecure

static Random makeSecure()

Source

Construct a cryptographically strong random number generator.

makeSeeded

static Random makeSeeded(Int seed := DateTime.nowTicks())

Source

Construct a repeatable, seeded random number generator.

next

abstract Int next(Range? r := null)

Source

Generate 64-bit integer within the given range. If range is null, assume full range of 64-bit integers

nextBool

abstract Bool nextBool()

Source

Generate random boolean.

nextBuf

abstract Buf nextBuf(Int size)

Source

Generate a randomized number of bytes.

nextFloat

abstract Float nextFloat()

Source

Generate 64-bit floating point number between 0.0f and 1.0f.