axolotl-pm / xoroshiro128pp
Xoroshiro128++ random number generator for PocketMine-MP
0.1.0
2026-08-24 05:25 UTC
Requires
- php: ^8.1
- php-64bit: *
- ext-gmp: *
Requires (Dev)
- phpstan/phpstan: 2.1.46
- phpstan/phpstan-phpunit: ^2.0.0
- phpstan/phpstan-strict-rules: ^2.0.0
- phpunit/phpunit: ^10.5.24
This package is auto-updated.
Last update: 2026-08-25 04:33:17 UTC
README
Xoroshiro128++ random number generator, made for use in PocketMine-MP.
Usage
use pocketmine\xoroshiro\Xoroshiro128PP; $random = Xoroshiro128PP::fromSeed($seed); $random->nextLong(); // signed 64-bit $random->nextFloat(); // [0, 1)
Xoroshiro128PP- the generator.fromSeed()expands one 64-bit seed into the 128-bit state the way Minecraft does; the constructor takes the two halves of the state directly.SplitMix64- the finaliser (Stafford variant 13) that seeding is built on, exposed because position hashes often need it on its own.
Requirements
- PHP 8.1 or newer, 64-bit
ext-gmp