Since: 8.2

final class Xoshiro256StarStar implements Engine (View source)

Methods

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

Constructs a new xoshiro256** engine

string
generate()

Generates randomness

void
jump()

Efficiently move the engine ahead by 2^128 steps

void
jumpLong()

Efficiently move the engine ahead by 2^192 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 xoshiro256** engine

Parameters

string|int|null $seed

How the internal 256 bit (32 byte) state consisting of four unsigned 64 bit integers is seeded depends on the type used as the seed. Type Description null Fills the state with 32 random bytes generated using the CSPRNG. int Fills the state with four consecutive values generated with the SplitMix64 algorithm that was seeded with seed interpreted as an unsigned 64 bit integer. string Fills the state by interpreting a 32 byte string as four little-endian unsigned 64 bit integers.

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()

Efficiently move the engine ahead by 2^128 steps

Moves the algorithm’s state ahead by 2128 steps, as if Random\Engine\Xoshiro256StarStar::generate was called 2128 times.

Return Value

void

No value is returned.

void jumpLong()

Efficiently move the engine ahead by 2^192 steps

Moves the algorithm’s state ahead by 2192 steps, as if Random\Engine\Xoshiro256StarStar::generate was called 2192 times.

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