RFC 9562 UUID implementation in Zig 0.16
zig uuid

add remaining RFC 9562 test vectors and the name space IDs master

Cover the vectors from the RFC that the tests did not yet use: the section 4 example UUID in its string, unsigned integer, and URN forms; the four UUIDv4 variant examples; and the nil and max string forms. Expose the well-known name space IDs from Table 3 (DNS, URL, OID, and X.500) as constants, along with a toBytes method that returns the network-byte-order bytes needed to hash a name space when creating v3 and v5 UUIDs. That allows the RFC's v3 and v5 examples to be tested end to end: the tests now compute the actual MD5 and SHA-1 of the DNS name space plus "www.example.com" and check that new() produces the RFC's expected UUIDs, instead of starting from hardcoded digests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N46mD8544YMCkkJ5Bafrmw


+119 -1
2 changed files