UUIDv3
UUIDv3 is a name-based, deterministic UUID that uses MD5 hashing. It generates the same UUID every time for a given name + namespace combination.
This makes it ideal for stable, repeatable identifiers across systems.
Generate a UUIDv3
use DomainFlow\Uuid\UuidV3;
$namespace = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; // DNS namespace
$name = 'example.com';
$uuid = UuidV3::generate($namespace, $name);
Validate a UUIDv3
UuidV3::isValid('2a444efc-3dcb-3bfb-bcd1-70d495b89b04');
Inspector Output
use DomainFlow\Uuid\Inspector;
$metadata = Inspector::analyze((string) $uuid)->metadata();
Output will include:
[
'hash_type' => 'MD5',
'deterministic' => true,
'note' => 'UUIDv3 encodes a hash of namespace + name'
]
Standard Namespaces
Some common namespaces for UUIDv3 (and v5):
6ba7b810-9dad-11d1-80b4-00c04fd430c8
– DNS6ba7b811-9dad-11d1-80b4-00c04fd430c8
– URL6ba7b812-9dad-11d1-80b4-00c04fd430c8
– ISO OID6ba7b814-9dad-11d1-80b4-00c04fd430c8
– X.500 DN
Use Cases
- Stable, hash-based UUIDs for resource names or external identifiers
- Avoiding collisions for known inputs (e.g. filenames, emails)
- Deterministic UUIDs in distributed systems
⚠️ Security note: Since it uses MD5 (which is considered insecure for cryptographic purposes), avoid UUIDv3 in security-critical contexts. Use UuidV5
instead if you need stronger hashing.