<?php
$blueprintRng = new \Random\Engine\Xoshiro256StarStar(0);
// Each parent engine will have its own chunk of 2**192 values.
$parent1 = clone $blueprintRng;
$blueprintRng->jumpLong();
$parent2 = clone $blueprintRng;
$blueprintRng->jumpLong();
// Each of the child engines will have its own chunk of 2**128 values
// taken from their parent engine’s chunk of 2**192 values.
$child1a = clone $parent1;
$parent1->jump();
$child1b = clone $parent1;
$parent1->jump();
$child2a = clone $parent2;
$parent2->jump();
$child2b = clone $parent2;
$parent2->jump();
echo "Child 1A: ", bin2hex($child1a->generate()), "\n";
echo "Child 1B: ", bin2hex($child1b->generate()), "\n";
echo "Child 2A: ", bin2hex($child2a->generate()), "\n";
echo "Child 2B: ", bin2hex($child2b->generate()), "\n";
?>
The above example will output:
Child 1A: b4f275cb365fec99
Child 1B: 2cd646c8ed156237
Child 2A: eb3729a722a504e7
Child 2B: d4208dc85bdd6dc3