UUID generator
v4 cryptographically secure random (in batches) · v5 name-based (the same name always gives the same value, RFC 4122)
UUID v4(随机,可批量)
UUID v5(基于名称,确定性:同命名空间 + 同名恒同值)
RFC 4122 §4.3:v5 = SHA1(命名空间字节 + 名称字节) 的前 16 字节,置位版本 5 与变体位——同一输入永远得到同一 UUID,适合把 URL/名称等稳定映射成唯一 ID(无需存库)。
FAQ
No. For v4 the randomness comes from the browser's CSPRNG (crypto.getRandomValues), and the v5 hash is computed in local JavaScript; no server request is made at any point, and reloading clears it.
v4 carries 122 random bits drawn from the browser's cryptographically secure generator (CSPRNG), good enough for unique business identifiers; for cryptographically sensitive uses, treat it as a “key”, not as a “secret”.
v5 is generated deterministically from a “namespace + name” (RFC 4122 §4.3): the same input always yields the same UUID. It suits mapping outside entities - URLs, file names and the like - stably onto unique IDs with no need to store the mapping.
v4: 1 to 500 at a time; v5 is single-valued (a deterministic function - generating from the same name again only ever gives the same value).