See Also
http://en.wikipedia.org/wiki/Universally_unique_identifier
Copyright
Copyright Johannes Pfau 2011 - .
| Category | Functions |
|---|---|
| Parsing UUIDs | parseUUID
|
| Generating UUIDs | sha1UUID
|
| Using UUIDs | UUID.uuidVersion, uuidVersion
UUID.variant, variant UUID.toString, toString UUID.data, data UUID.swap, swap UUID.opEquals, opEquals UUID.opCmp, opCmp UUID.toHash, toHash |
| UUID namespaces | dnsNamespace
urlNamespace oidNamespace x500Namespace |
UUID.init, which is a UUID with all 16 bytes set to 0.bool empty() @trusted pure nothrow @nogc @property constReturns true if and only if the UUID is equal to {00000000-0000-0000-0000-000000000000}SysTime v7Timestamp() constIf the UUID is of version 7 it has a timestamp that this function returns, otherwise and UUIDParsingException is thrown.Variant variant() @safe pure nothrow @nogc @property constRFC 4122 defines different internal data layouts for UUIDs. Returns the format used by this UUID.Version uuidVersion() @safe pure nothrow @nogc @property constRFC 4122 defines different UUID versions. The version shows how a UUID was generated, e.g. a version 4 UUID was generated from a random number, a version 3 UUID from an MD5 hash of a name. Returns ...bool opEquals(const UUID s) @safe pure nothrow @nogc constAll of the standard numeric operators are defined for the UUID struct.void toString(Writer)(scope Writer sink) constWrite the UUID into `sink` as an ASCII string in the canonical form, which is 36 characters in the form "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" Params: sink = OutputRange or writeable array at least...this(ref const scope ubyte[16] uuidData)Construct a UUID struct from the 16 byte representation of a UUID.this(const ubyte[16] uuidData)dittothis(T uuidData)Construct a UUID struct from the 16 byte representation of a UUID. Variadic constructor to allow a simpler syntax, see examples. You need to pass exactly 16 ubytes.this(in T[] uuid)<a name="UUID(string)"></a> Parse a UUID from its canonical string form. An UUID in its canonical form looks like this: 8ab3060e-2cba-4f23-b74c-b52db3bdfb46VariantRFC 4122 defines different internal data layouts for UUIDs. These are the UUID formats supported by this module. It's possible to read, compare and use all these Variants, but UUIDs generated by th...VersionRFC 4122 defines different UUID versions. The version shows how a UUID was generated, e.g. a version 4 UUID was generated from a random number, a version 3 UUID from an MD5 hash of a name.This exception is thrown if an error occurs when parsing a UUID from a string.
Reason reasondittostring inputThe original input string which should have been parsed.size_t positionThe position in the input string where the error occurred.this(string input, size_t pos, Reason why = Reason.unknown, string msg = "",
Throwable next = null, string file = __FILE__, size_t line = __LINE__)ReasonThe reason why parsing the UUID string failed (if known)UUID md5UUID(const(char[]) name, const UUID namespace = UUID.init) @safe pure nothrow @nogcThis function generates a name based (Version 3) UUID from a namespace UUID and a name. If no namespace UUID was passed, the empty UUID `UUID.init` is used.UUID sha1UUID(scope const(char)[] name, scope const UUID namespace = UUID.init) @safe pure nothrow @nogcThis function generates a name based (Version 5) UUID from a namespace UUID and a name. If no namespace UUID was passed, the empty UUID `UUID.init` is used.UUID sha1UUID(scope const(ubyte)[] data, scope const UUID namespace = UUID.init) @safe pure nothrow @nogcdittoUUID randomUUID() @nogc nothrow @safeThis function generates a random number based UUID from a random number generator.UUID randomUUID(RNG)(ref RNG randomGen) if (isInputRange!RNG && isIntegral!(ElementType!RNG))dittoUUID parseUUID(T)(T uuidString) if (isSomeString!T)This is a less strict parser compared to the parser used in the UUID constructor. It enforces the following rules:dnsNamespace = UUID("6ba7b810-9dad-11d1-80b4-00c04fd430c8")Default namespace from RFC 4122
Name string is a fully-qualified domain name
urlNamespace = UUID("6ba7b811-9dad-11d1-80b4-00c04fd430c8")Default namespace from RFC 4122
Name string is a URL
oidNamespace = UUID("6ba7b812-9dad-11d1-80b4-00c04fd430c8")Default namespace from RFC 4122
Name string is an ISO OID
x500Namespace = UUID("6ba7b814-9dad-11d1-80b4-00c04fd430c8")Default namespace from RFC 4122
Name string is an X.500 DN (in DER or a text output format)
uuidRegex = "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}" ~
"-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"Regex string to extract UUIDs from text.