Since: 8.2

final class PcgOneseq128XslRr64 implements Engine (View source)

Methods

__construct(string|int|null $seed = null)

Constructs a new PCG Oneseq 128 XSL RR 64 engine

string
generate()

Generates randomness

void
jump(int $advance)

Efficiently move the engine ahead multiple steps

array
__serialize()

No description

void
__unserialize(array $data)

No description

array
__debugInfo()

No description

Details

__construct(string|int|null $seed = null)

Constructs a new PCG Oneseq 128 XSL RR 64 engine

Parameters

string|int|null $seed

How the internal 128 bit (16 byte) state consisting of one unsigned 128 bit integer is seeded depends on the type used as the seed. Type Description null Fills the state with 16 random bytes generated using the CSPRNG. int Fills the state by setting the state to 0, advancing the engine one step, adding the value of seed interpreted as an unsigned 64 bit integer, and advancing the engine another step. string Fills the state by interpreting a 16 byte string as a little-endian unsigned 128 bit integer.

string generate()

Generates randomness

Returns randomness and advances the algorithm’s state by one step.

Return Value

string

A non-empty string containing random bytes. The Random\Randomizer works with unsigned 64 bit integers internally. If the returned string contains more than 64 bit (8 byte) of randomness the exceeding bytes will be ignored. Other applications may be able to process more than 64 bit at once.

void jump(int $advance)

Efficiently move the engine ahead multiple steps

Moves the algorithm’s state ahead by the number of steps given by advance, as if Random\Engine\PcgOneseq128XslRr64::generate was called that many times.

Parameters

int $advance

The number of steps to move ahead; must be 0 or greater.

Return Value

void

No value is returned.

array __serialize()

No description

Return Value

array

void __unserialize(array $data)

No description

Parameters

array $data

Return Value

void

array __debugInfo()

No description

Return Value

array