Module artichoke_backend::extn::core::random[][src]

Random provides an interface to Ruby’s pseudo-random number generator, or PRNG. The PRNG produces a deterministic sequence of bits which approximate true randomness. The sequence may be represented by integers, floats, or binary strings.

This module implements the Random singleton object from Ruby Core.

In Artichoke, Random is implemented using a modified Mersenne Twister that reproduces the same byte and float sequences as the MRI implementation.

You can use this class in your application by accessing it directly. As a Core API, it is globally available:

Random::DEFAULT.bytes(16)
r = Random.new(33)
r.rand

Modules

mruby

FFI glue between the Rust trampolines and the mruby C interpreter.

trampoline

Glue between mruby FFI and ENV Rust implementation.

Structs

Random

Enums

Max

A range constraint for generating random numbers.

Rand

A generated random number.

Seed

Functions

new_seed
srand
urandom