UUID v5 Generator

What is this?

This page generates UUID v5 IDs for you to use in debugging, development, or anywhere else you may need a unique ID.

What is UUID v5?

UUID v5 is a namespace-based UUID, meaning it is generated using a namespace and a name. The namespace is itself a UUID, and the name can be any string.

v5 is very similar to v3, but uses SHA-1 instead of MD5. This means that v5 is slower, but more secure.

What is UUID v5?

UUID v5 is a namespace-based UUID, meaning it is generated using a namespace and a name. The namespace is itself a UUID, and the name can be any string.

RFC 4122 presents some potentially interesting namespaces for application in UUID v5:

  • DNS - 6ba7b810-9dad-11d1-80b4-00c04fd430c8
  • URL - 6ba7b811-9dad-11d1-80b4-00c04fd430c8
  • OID - 6ba7b812-9dad-11d1-80b4-00c04fd430c8
  • X.500 - 6ba7b814-9dad-11d1-80b4-00c04fd430c8

What is a UUID?

A UUID is a Universally Unique IDentifier. It is a 128-bit number used to uniquely identify something. It is usually represented as a 32-character hexadecimal string with hyphens.

UUIDs come in several versions. The most frequent is v4, which is randomly generated. This is the version used by this page.

Why use UUIDs?

UUIDs are meant to be Universally Unique. This means you should be able to generate a UUID anywhere and be confident that it will not collide with another UUID generated anywhere else.

UUIDs are also instantly recognizable as IDs. This makes them easy to pick out in logs or other text.

Some databases (for example, Postgres) can also efficiently represent UUIDs as 128 bit integers instead of 288 bit strings. This makes them suitable for use as primary keys without a significant performance penalty.

What are some of the shortcomings of UUIDs?

UUIDs are not guaranteed to be unique. They are only guaranteed to be unique with a certain probability. The probability of a collision, or two UUIDs being the same, is very low, but it is not zero.

UUIDs can also leak information about the underlying system that generated them. For example, the MAC address of the network interface card can be used to generate a UUID. This can be used to track a device across networks.

There are several alternatives to UUIDs with various tradeoffs. For a review, see our article (coming soon).