The Mersenne Twister in PHP - A seedable pseudorandom number generator

Installs: 6 226

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/superdupercybertechno/randy

1.0.0 2019-11-14 10:55 UTC

This package is auto-updated.

Last update: 2025-09-15 00:17:30 UTC


README

The Mersenne Twister in PHP - A seedable pseudorandom number generator

Based on this.

Install it using composer:

composer install superdupercybertechno/randy

To use it, add the following to your file:

use superDuperCyberTechno\Randy\Randy;

When you need it, simply invoke it and request numbers.

$randy = new Randy($seed);
$number = $randy->num(0,100);

Where $seed is a string of your choosing. If you leave out $seed, Randy will seed itself with a random number. Each time you run the method num you will receive a new number within the limits passed (0 and 100 in the above example). Using the same seed will produce a predictable batch of numbers.