Shim

UUID Generator

Random v4 UUIDs, as many as you need.

Random v4 UUIDs, as many as you need.

How to use it

  1. Choose how many you need. One for a quick test, or up to five hundred for seeding a table.
  2. Copy them. One per line, ready to paste into a query, a fixture file or a spreadsheet.
  3. Use them as keys. They are safe as primary keys or identifiers. Nothing about them encodes when or where they were made.

When you would use this

A version 4 UUID is 122 random bits with six more spent on saying what it is. That is enough that you can generate them independently on different machines and never coordinate, which is the entire reason they exist. These are drawn from the browser's cryptographic random source rather than the ordinary one, which matters more than it might seem: identifiers built on a clock-seeded generator can be guessed by anyone who knows roughly when a record was created, and that has been a real vulnerability in real systems. The version and layout bits are set explicitly rather than left to chance, because a UUID with the wrong version nibble looks perfectly normal and is rejected by anything that validates it.

Questions

Can you see what this generates?
No. There is no server involved. The page is static files and the randomness comes from your own browser, so there is nothing for anyone to log.
Are these safe to use as database keys?
Yes. They carry 122 random bits from the same source used for security tokens, so a collision is not something you need to plan for.
What makes it version 4?
Six of the 128 bits are fixed: four mark the version and two mark the layout. The other 122 are random. Getting those bits wrong produces something that looks right and fails validation.