mathRNG method Null safety
- {int seed = -1}
Math.Random()-based RNG. All platforms, fast, not cryptographically strong. Optional Seed passable.
Implementation
static Uint8List mathRNG({int seed = -1}) {
var b = Uint8List(16);
var rand = (seed == -1) ? Random() : Random(seed);
for (var i = 0; i < 16; i++) {
b[i] = rand.nextInt(256);
}
(seed == -1) ? b.shuffle() : b.shuffle(Random(seed));
return b;
}