@@ -16,7 +16,7 @@ import (
1616)
1717
1818// A UUID is a 128 bit (16 byte) Universal Unique IDentifier as defined in RFC
19- // 4122 .
19+ // 9562 .
2020type UUID [16 ]byte
2121
2222// A Version represents a UUID's version.
@@ -28,12 +28,17 @@ type Variant byte
2828// Constants returned by Variant.
2929const (
3030 Invalid = Variant (iota ) // Invalid UUID
31- RFC4122 // The variant specified in RFC4122
31+ RFC4122 // The variant specified in RFC9562(obsoletes RFC4122).
3232 Reserved // Reserved, NCS backward compatibility.
3333 Microsoft // Reserved, Microsoft Corporation backward compatibility.
3434 Future // Reserved for future definition.
3535)
3636
37+ // RFC9562 added V6 and V7 of UUID, but did not change specification of V1 and V4
38+ // implemented in this module. To avoid creating new major module version,
39+ // we still use RFC4122 for constant name.
40+ const Standard = RFC4122
41+
3742const randPoolSize = 16 * 16
3843
3944var (
@@ -57,7 +62,7 @@ func IsInvalidLengthError(err error) bool {
5762}
5863
5964// Parse decodes s into a UUID or returns an error if it cannot be parsed. Both
60- // the standard UUID forms defined in RFC 4122
65+ // the standard UUID forms defined in RFC 9562
6166// (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and
6267// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) are decoded. In addition,
6368// Parse accepts non-standard strings such as the raw hex encoding
0 commit comments