- What's the difference between v4 and v7?
- v4 is fully random. v7 prepends a millisecond timestamp so IDs sort chronologically, which is friendlier to database indexes.
- What is a UUID (or GUID)?
- A UUID (Universally Unique Identifier), also called a GUID on Microsoft platforms, is a 128-bit value written as 32 hex digits in five hyphen-separated groups. It identifies something uniquely without a central authority handing out numbers.
- Are UUIDs guaranteed to be unique?
- Not guaranteed, but collisions are astronomically unlikely. A v4 UUID has 122 random bits, so you would need to generate billions per second for many years before a clash became probable.
- Are these generated offline?
- Yes. IDs are created in your browser with window.crypto, so nothing is requested from a server and nothing you generate is logged.
- Does a v7 UUID reveal when it was created?
- Yes. v7 embeds a millisecond timestamp, so the creation time is recoverable from the ID. Use v4 if you need the value to leak nothing about timing.