Skip to content
class method

Random.new

Random.new(seed = Random.new_seed) → prng

Creates a new PRNG using seed to set the initial state. If seed is omitted, the generator is initialized with Random.new_seed.

See Random.srand for more information on the use of seed values.

Ruby version changes

  1. 3.0
See also .bytes .new_seed .rand also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0