Seeded Random Engine
An array of seeded random number generators that can enable multiple devices to be primitively synchronized.
Example usage
import SeededRandomEngine from "seeded-random-engine";
const engine = new SeededRandomEngine({
seed: "A unique case sensitive string",
cores: 4,
memory: 10,
});
engine.generate();
console.log(engine.values());
engine.to(57);
console.log(engine.values());
engine.generate();
console.log(engine.values());
What is this useful for?
Say we want a number of devices to see the same new random number every time a button is pressed.
One way we could do this would be to randomly generate a number and update the devices over the network solution using something like web sockets. That solution, while valid, is somewhat overkill if all I need is a synchronized random number generator.
Enter the seeded random engine. The concept is that if devices share a seed, multiple random number generators (RNGs) can be synchronised between the devices.
The core use case for this engine is one where human beings can do that sync easily together. I can tell my friend "enter seed 'willie' and we are at generation 100." With two small inputs, my friend can sync their device with everyone else and be looking at the exact same randomized data.