web: seed rerolls draw from a readable range

Per Justin: a full uint32 made rerolled seeds ten digits long. Rerolls
now draw 0-9999; still thousands of distinct worlds, but the advanced
fields and shared URLs stay legible.
This commit is contained in:
Justin Visser 2026-06-10 18:22:11 +02:00
parent c5cbfd3eea
commit 5c4a92b5a0

View file

@ -48,10 +48,12 @@ function setField(field: keyof Config, event: Event) {
if (Number.isFinite(nextValue)) store.setBaseField(field, nextValue)
}
// Seeds are just names for worlds; a small range keeps the fields and
// shared URLs readable while still giving plenty of distinct worlds.
function freshSeed(): number {
const buffer = new Uint32Array(1)
crypto.getRandomValues(buffer)
return buffer[0] ?? 0
return (buffer[0] ?? 0) % 10000
}
function reroll(field: keyof Config) {