All Tools

UUID v5 Generator

Generate version 5 UUIDs using SHA-1 hashing of a namespace and name. More secure than v3 with SHA-1 instead of MD5.

Configuration

Generated UUIDs

Click 'Generate' to create UUIDs

Generate UUID version 5

Formula

UUID v5 is generated using SHA-1 hashing:

textUUID=textSHA−1(textnamespace∣textname)[0:16]textwithversion5\\text{UUID} = \\text{SHA-1}(\\text{namespace} \\| \\text{name})[0:16] \\text{ with version 5}

Where:

  • namespace is a UUID
  • name is a string identifier
  • \| is concatenation
  • [0:16] takes the first 16 bytes (128 bits)

Structure

xxxxxxxx-xxxx-5xxx-xxxx-xxxxxxxxxxxx

The 5 in the third group indicates version 5.

Worked example

Using the DNS namespace (6ba7b810-9dad-11d1-80b4-00c04fd430c8) and the name "www.example.com":

  1. Concatenate: 6ba7b810-9dad-11d1-80b4-00c04fd430c8www.example.com
  2. SHA-1 hash: 82d32265d2a63c7c9e5b3c4e8f9a1b2c (truncated to 128 bits)
  3. Set version bits: 82d32265-d2a6-5c7c-9e5b-3c4e8f9a1b2c

Result: 82d32265-d2a6-5c7c-9e5b-3c4e8f9a1b2c

How to use

  1. Enter a namespace UUID (or use a standard one)
  2. Enter the name string
  3. Click "Generate" to create a UUID v5

Standard namespaces

| Namespace | UUID | |-----------|------| | 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 |

Advantages

  • Deterministic: Same namespace + name always produces the same UUID
  • Cryptographically secure: SHA-1 is more secure than MD5 (v3)
  • Universally unique: Different names produce different UUIDs
  • No privacy concerns: No personal information exposed

Disadvantages

  • SHA-1 has known weaknesses: Not suitable for security purposes
  • Not reversible: Cannot recover the original name from the UUID
  • Slower than v3: SHA-1 is computationally more expensive than MD5

v3 vs v5 comparison

| Feature | UUID v3 | UUID v5 | |---------|---------|---------| | Hash algorithm | MD5 | SHA-1 | | Speed | Faster | Slower | | Security | Weaker | Stronger | | Collision resistance | Good | Better | | Recommendation | Legacy only | Prefer v5 |

Common use cases

  • Database keys for deterministic IDs
  • URL identifiers
  • File path hashing
  • Namespace-based identifiers
  • Standard-compliant applications

FAQ

What is the difference between v3 and v5? v3 uses MD5, v5 uses SHA-1. v5 is preferred for security.

Can I generate a UUID v5 from a URL? Yes, use the URL namespace and the full URL as the name.

Is UUID v5 unique? Yes, globally unique as long as you use different names.

Can I use any string as namespace? Yes, but standard namespaces ensure compatibility.

How do I verify a v5 UUID? Extract the namespace and name, hash with SHA-1, and compare.

Should I use v5 instead of v3? Yes, prefer v5 for better security. Use v3 only for legacy compatibility.

Is SHA-1 safe for this? For UUID generation (not cryptographic security), SHA-1 is still acceptable. The SHA-3 standard defines UUID v6-v8 using newer hashes.

Other related tools