UUID (v4) Identifier Generator
Generate secure, universally unique identifiers (UUID v4) for API transaction keys or session indexes.
How It Works
- Select UUID quantity and formatting options (hyphens, uppercase, braces).
- The generator uses crypto.getRandomValues() to generate 128-bit RFC 4122 Version 4 random UUIDs.
- Variant and version bits (e.g. 4xxx-8xxx/9xxx/axxx/bxxx) are set according to standard.
Primary Use Cases
- Generating unique database primary keys and transaction IDs without centralized counter coordination.
- Creating distributed tracing correlation IDs (OpenTelemetry, Jaeger).
- Generating nonce tokens for session IDs and cryptographic challenge-responses.
Common Security Pitfalls
- Using UUID v4 as database primary keys on high-volume clustered indexes without considering index fragmentation (UUID v7 is preferred for sequential ordering).
- Assuming UUIDs are secret tokens (UUIDs are globally unique, but not inherently secret).
Frequently Asked Questions
- What is the probability of a UUID v4 collision?
- After generating 1 billion UUIDs per second for 100 years, the probability of creating a single duplicate is approximately 50%. The probability is virtually zero.
- What are the version bits in a UUID?
- In a UUID like xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx, the 4 indicates Version 4 (randomly generated), and the y indicates the RFC 4122 variant.
References & Standards