Gets the version of this UUID. RFC 4122 defines five types of UUIDs: - Version 1 is based on the system's MAC address and the current time. - Version 2 uses the current user's userid and user domain in addition to the time and MAC address. - Version 3 is namespace-based, as generated by the NamespaceGenV3 module. It uses MD5 as a hash algorithm. RFC 4122 states that version 5 is preferred over version 3. - Version 4 is generated randomly. - Version 5 is like version 3, but uses SHA-1 rather than MD5. Use the NamespaceGenV5 module to create UUIDs like this.
Determines if this UUID has the same value as another.
Get a copy of this UUID's value as an array of unsigned bytes.
Get a hash code representing this UUID.
Get the canonical string representation of a UUID. The canonical representation is in hexidecimal, with hyphens inserted after the eighth, twelfth, sixteenth, and twentieth digits. For example: 67e55044-10b1-426f-9247-bb680e5fe0c8 This is the format used by the parsing functions.
Return an empty UUID (with all bits set to 0). This doesn't conform * to any particular version of the specification. It's equivalent to * using an uninitialized UUID. This method is provided for clarity.
Copy the givent bytes into a UUID. If you supply more or fewer than * 16 bytes, throws an IllegalArgumentException.
Attempt to parse the representation of a UUID given in value. If the value is not in the correct format, throw IllegalArgumentException. If the value is in the correct format, return a UUID representing the given value.
Generate a UUID based on the given random number generator. * The generator must have a method 'uint natural()' that returns * a random number. The generated UUID conforms to version 4 of the * specification.
Attempt to parse the representation of a UUID given in value. If the value is not in the correct format, return false rather than throwing an exception. If the value is in the correct format, set uuid to represent the given value.
This struct represents a UUID. It offers static members for creating and parsing UUIDs.
This struct treats a UUID as an opaque type. The specification has fields for time, version, client MAC address, and several other data points, but these are meaningless for most applications and means of generating a UUID.
There are versions of UUID generation involving the system time and MAC address. These are not used for several reasons: - One version contains identifying information, which is undesirable. - Ensuring uniqueness between processes requires inter-process communication. This would be unreasonably slow and complex. - Obtaining the MAC address is a system-dependent operation and beyond the scope of this module. - Using Java and .NET as a guide, they only implement randomized creation of UUIDs, not the MAC address/time based generation.
When generating a random UUID, use a carefully seeded random number generator. A poorly chosen seed may produce undesirably consistent results.