crypto.randomUUID() Playground

Mrs. Tini moves the cooperative’s member book onto a computer: make thousands of member numbers with Math.random, Date.now, getRandomValues or…

Why it matters

Unique ids are everywhere: React keys, primary keys, upload file names, idempotency keys. A number cut short collides much sooner than you would guess, Date.now() collides within one millisecond, and Math.random is not safe randomness for tokens.

The key idea

Unique is about space: 122 random bits from crypto.randomUUID

Common mistakes

Try it in this playground