(seed: number)
| 13 | |
| 14 | /** mulberry32 — small deterministic PRNG */ |
| 15 | export function mulberry32(seed: number): () => number { |
| 16 | let a = seed >>> 0; |
| 17 | return () => { |
| 18 | a |= 0; |
| 19 | a = (a + 0x6d2b79f5) | 0; |
| 20 | let t = Math.imul(a ^ (a >>> 15), 1 | a); |
| 21 | t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t; |
| 22 | return ((t ^ (t >>> 14)) >>> 0) / 4294967296; |
| 23 | }; |
| 24 | } |
| 25 | |
| 26 | /** FNV-1a over a string — derive a per-entry seed so results are independent |
| 27 | * of iteration order. */ |
no outgoing calls
no test coverage detected