Alea non-cryptographic pseudo-random number generator.
More...
|
| | __construct (... $args) |
| | Create a new pseudo-random number generator.
|
| |
| | random () |
| | Get a float with 32 bits of randomness.
|
| |
| | uint32 () |
| | Get a random 32-bit unsigned integer.
|
| |
| | fract53 () |
| | Get a float with the full 53 bits of randomness.
|
| |
|
| args () |
| |
| | exportState () |
| |
| | importState (array $i) |
| |
|
|
static | version () |
| |
| static | createWithState (array $i) |
| | Create a new generator synced with some exported state.
|
| |
Alea non-cryptographic pseudo-random number generator.
Compatible with https://www.npmjs.com/package/alea
From http://baagoe.com/en/RandomMusings/javascript/
Archived at:
◆ __construct()
| Wikimedia\Alea\Alea::__construct |
( |
| $args | ) |
|
Create a new pseudo-random number generator.
- Parameters
-
| mixed | ...$args Seeds for the PRNG. Can be anything which can be converted to a string with 'strval'. |
◆ createWithState()
| static Wikimedia\Alea\Alea::createWithState |
( |
array | $i | ) |
|
|
static |
Create a new generator synced with some exported state.
- Parameters
-
| array | $i | The exported state of some other Alea PRNG. |
- Returns
- Alea a new Alea PRNG.
◆ exportState()
| Wikimedia\Alea\Alea::exportState |
( |
| ) |
|
- Returns
- array The exported state of this PRNG.
◆ fract53()
| Wikimedia\Alea\Alea::fract53 |
( |
| ) |
|
Get a float with the full 53 bits of randomness.
- Returns
- float
◆ importState()
| Wikimedia\Alea\Alea::importState |
( |
array | $i | ) |
|
- Parameters
-
| array | $i | The exported state of some other Alea PRNG. |
◆ random()
| Wikimedia\Alea\Alea::random |
( |
| ) |
|
Get a float with 32 bits of randomness.
- Returns
- float
◆ uint32()
| Wikimedia\Alea\Alea::uint32 |
( |
| ) |
|
Get a random 32-bit unsigned integer.
- Returns
- int
The documentation for this class was generated from the following file: