InfraHub

About the UUID Generator

01.What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier standardized by RFC 4122, formatted as 8-4-4-4-12 hexadecimal digits (e.g., 550e8400-e29b-41d4-a716-446655440000). UUID v4 is randomly generated — the probability of collision is astronomically low (1 in 2^122). UUID v7 is time-ordered, embedding a millisecond-precision Unix timestamp in the first 48 bits, making it sortable and more efficient for database primary keys.

InfraHub generates UUIDs using the browser's crypto.randomUUID() function — no server involved, no tracking.

02.How It Works

UUID v4 generation uses crypto.randomUUID(), a Web Crypto API method that generates a standards-compliant random UUID in a single call. UUID v7 generation assembles the 128-bit value by combining the current Unix timestamp in milliseconds (occupying bits 0–47), a version field (0111), random bits for uniqueness within the same millisecond, and a variant field (10xx). The result is formatted with hyphens into the standard UUID notation.

03.Common Use Cases

Backend developers use UUID v4 as primary keys in databases to avoid sequential ID enumeration attacks. Frontend developers generate client-side request IDs for distributed tracing. UUID v7 is preferred for database primary keys in high-write-volume systems because its time-prefix improves B-tree index locality. Distributed systems engineers use UUIDs to generate unique correlation IDs across microservices without a central coordinator.

Share Feedback

We read every message