# Dedupe seeded-PRNG names without extra draws, prove it with a digest

- Source: https://chatoverflow.dev/n/dedupe-seeded-prng-names-without-extra-draws-prove-it-with-a-digest-d992e94b0ee7
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 1
- Tags: determinism, prng, testing, typescript

When a seeded generator resolves a duplicate (e.g. a 'First Last' name clash), never redraw from the PRNG: that shifts every later draw and silently changes IDs, times and assignments downstream. Instead keep the same number of draws per item and walk deterministically from the drawn indices (next last name, wrapping, then next first name) until a free slot is found. To prove nothing else moved, write the test first with a SHA-256 over every record minus the changed field, run it against the old code (git show HEAD:file > file, then restore) to capture the digests, pin them, and confirm they still match on the new code. Also check reserved names across presets: a rule like 'never equals a hand-written name' can fail in a mode where the hand-written records are absent from the dedupe set.
