package
0.0.0-20241226145920-483c662f7ff1
Repository: https://github.com/pingooio/stdx.git
Documentation: pkg.go.dev
# Functions
ClockSequence returns the current clock sequence, generating one if not already set.
Compare returns an integer comparing two uuids lexicographically.
DisableRandPool disables the randomness pool if it was previously enabled with EnableRandPool.
EnableRandPool enables internal randomness pool used for Random (Version 4) UUID generation.
FromBytes creates a new UUID from a byte slice.
GetTime returns the current Time (100s of nanoseconds since 15 Oct 1582) and clock sequence as well as adjusting the clock sequence as needed.
IsInvalidLengthError is matcher function for custom error invalidLengthError.
Must returns uuid if err is nil and panics otherwise.
MustParse is like Parse but panics if the string cannot be parsed.
NewDCEGroup returns a DCE Security (Version 2) UUID in the group domain with the id returned by os.Getgid.
NewDCEPerson returns a DCE Security (Version 2) UUID in the person domain with the id returned by os.Getuid.
NewDCESecurity returns a DCE Security (Version 2) UUID.
NewHash returns a new UUID derived from the hash of space concatenated with data generated by h.
NewMD5 returns a new MD5 (Version 3) UUID based on the supplied name space and data.
NewRandomFromReader returns a UUID based on bytes read from a given io.Reader.
NewSHA1 returns a new SHA1 (Version 5) UUID based on the supplied name space and data.
NewUUID returns a Version 1 UUID based on the current NodeID and clock sequence, and the current time.
New creates a new random UUID or panics.
UUID version 6 is a field-compatible version of UUIDv1, reordered for improved DB locality.
UUID version 7 features a time-ordered value field derived from the widely implemented and well known Unix Epoch timestamp source, the number of milliseconds seconds since midnight 1 Jan 1970 UTC, leap seconds excluded.
NewV7FromReader returns a Version 7 UUID based on the current time(Unix Epoch).
No description provided by the author
NodeID returns a slice of a copy of the current Node ID, setting the Node ID if not already set.
NodeInterface returns the name of the interface from which the NodeID was derived.
Parse decodes s into a UUID or returns an error if it cannot be parsed.
ParseBytes is like Parse, except it parses a byte slice instead of a string.
SetClockSequence sets the clock sequence to the lower 14 bits of seq.
SetNodeID sets the Node ID to be used for Version 1 UUIDs.
SetNodeInterface selects the hardware address to be used for Version 1 UUIDs.
SetRand sets the random number generator to r, which implements io.Reader.
Validate returns an error if s is not a properly formatted UUID in one of the following formats:
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
It returns an error if the format is invalid, otherwise nil.
# Constants
Reserved for future definition.
Domain constants for DCE Security (Version 2) UUIDs.
Invalid UUID.
Reserved, Microsoft Corporation backward compatibility.
Domain constants for DCE Security (Version 2) UUIDs.
Domain constants for DCE Security (Version 2) UUIDs.
Reserved, NCS backward compatibility.
The variant specified in RFC9562(obsoletes RFC4122).
No description provided by the author
RFC9562 added V6 and V7 of UUID, but did not change specification of V1 and V4 implemented in this module.
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
The Max UUID is special form of UUID that is specified to have all 128 bits set to 1.
Well known namespace IDs and UUIDs.
Well known namespace IDs and UUIDs.
Well known namespace IDs and UUIDs.
Well known namespace IDs and UUIDs.
empty UUID, all zeros.
# Structs
NullUUID represents a UUID that may be null.
No description provided by the author
# Type aliases
A Domain represents a Version 2 domain.
A Time represents a time as the number of 100's of nanoseconds since 15 Oct 1582.
A UUID is a 128 bit (16 byte) Universal Unique IDentifier as defined in RFC 9562.
UUIDs is a slice of UUID types.
A Variant represents a UUID's variant.
A Version represents a UUID's version.