UUID v4 Generator UUID v4 生成器


            

What is UUID v4?

UUID (Universally Unique Identifier) is a 128-bit identifier standard defined by RFC 4122. Version 4 is generated entirely from random numbers, requiring no central authority. The format is 8-4-4-4-12 hexadecimal characters, e.g., 550e8400-e29b-41d4-a716-446655440000. With 122 effective random bits, the chance of collision is negligible even at massive scale — roughly one in 5.3 × 10³⁶.

Why Use UUID as a Primary Key?

UUIDs can be generated client-side without a database round-trip, which is ideal for distributed systems, offline-first apps, and microservice architectures. Unlike auto-increment IDs, they do not leak record counts or creation order, improving security. They are the standard for session tokens, file identifiers, API resources, and distributed transaction IDs. This tool uses the browser's native crypto.randomUUID() API, guaranteeing cryptographic-grade randomness.

什么是 UUID v4?

UUID(通用唯一识别码)是 RFC 4122 定义的 128 位标识符标准。v4 版本完全基于随机数生成,无需中央注册机构。格式为 8-4-4-4-12 十六进制字符,例如 550e8400-e29b-41d4-a716-446655440000。具有 122 位有效随机位,即便大规模生成也几乎不会碰撞(概率约为 5.3×10³⁶ 分之一)。

UUID 作为数据库主键的优势

UUID 可在客户端生成,无需数据库往返,非常适合分布式系统、离线应用和微服务架构。与自增 ID 相比,UUID 不会泄露记录数量或创建顺序,安全性更高。常用于会话 Token、文件标识符、API 资源 ID 和分布式事务 ID。本工具使用浏览器原生 crypto.randomUUID() API,保证密码学级别的随机性。