Documentation
¶
Index ¶
Constants ¶
View Source
const ( UUIDv5NamespaceDNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8" UUIDv5NamespaceURL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8" UUIDv5NamespaceOID = "6ba7b812-9dad-11d1-80b4-00c04fd430c8" UUIDv5NamespaceX500 = "6ba7b814-9dad-11d1-80b4-00c04fd430c8" )
UUIDv5 namespaces Source: https://www.rfc-editor.org/rfc/rfc4122#appendix-C
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UUIDv5 ¶
type UUIDv5 struct {
uuid.UUID
Namespace uuid.UUIDInterface
Name string
// contains filtered or unexported fields
}
UUIDv5 is a name-based UUID (version 5). It is derived from SHA-1(namespaceUUID || name) with version=5 and RFC 4122 variant.
func (*UUIDv5) FromString ¶
FromString parses a UUID string in the format "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" and returns a UUIDv5 structure.
Parameters:
- uuidStr: A string containing the UUID in the format "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Returns:
- An error if the UUID is invalid or the conversion fails
func (*UUIDv5) Marshal ¶
Marshal converts the UUIDv5 structure to a 16-byte array
Returns:
- A byte slice containing the UUID's 16 bytes
- An error if the UUID is invalid or the conversion fails
Click to show internal directories.
Click to hide internal directories.