A German Wikipedia entry for UUID provided an example for www.example.org :
6ba7b810-9dad-11d1-80b4-00c04fd430c8 // namespace UUID www.example.org // url 74738ff5-5367-5958-9aee-98fffdcd1876 // expected UUID
In addition, Java offers a UUID class that can be used to generate test data . (EDIT: This seems to only be able to generate versions 1,2,3 and 4 UUIDs.)
There, the answer in your question mentions some libraries that can generate UUIDs with version 3/5:
It seems that there are several libraries out there for generating version 3/5 of the UUID, including the python uuid module boost.uuid (C ++) and OSSP UUID. (I have not searched for any .net ones)
OP Edit
The example in DE wikipedia has a slight error:
- he claims to use the
DNS name www.example.org - given ASCII byte sequence for
www.example.com - but the SHA1 hash uses
www.example.org .
I would edit the page to change the sequence of bytes from
0x63 0x6f 0x6d "com"
for the image 0x6f 0x72 0x67 "org"
but I donβt speak German, I donβt want to create an account, and I'm just too lazy
Example comes down to
Namespace_DNS: {6ba7b810-9dad-11d1-80b4-00c04fd430c8} Name: "www.example.org"
combine byte sequences:
Bytes: 6b a7 b8 10 9d ad 11 d1 80 b4 00 c0 4f d4 30 c8 {6ba7b810-9dad-11d1-80b4-00c04fd430c8} 77 77 77 2e 65 78 61 6d 70 6c 65 2e 6f 72 67 "www.example.org"
Hash the byte sequence with SHA1 and copy most of it directly to the UUID:
SHA1 Digest: 74738ff5 5367 e958 9aee98fffdcd187694028007 UUID (v5): 74738ff5-5367-5958-9aee-98fffdcd1876 ^ ^
And pay attention to the conversion of one of the nibbles to 5 (to indicate version 5).
And the upper 2 bits of another byte are set to binary 10xxxxxx .
source share