Understanding UUID v4
Unlike v1 (time-based) or v5 (namespace-hash) UUIDs, version 4 uses almost entirely random values, aside from six bits marking the version and variant. That means no predictable links between records, which is why it's the default choice for distributed databases, security tokens, and session keys.
Cryptographic randomness
This generator uses the browser's native crypto.randomUUID(), which draws from your operating system's entropy pool, far more robust than a plain Math.random() call.
Collision odds
The 128-bit structure yields roughly 340 undecillion possibilities. For practically any application, even at massive scale, duplicate identifiers never happen.