View source code Display the source code in std/uuid.d from which this page was generated on github. Improve this page Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone. Page wiki View or edit the community-maintained wiki page associated with this page.

Struct std.uuid.UUID

Constructors

Name Description
this Construct a UUID struct from the 16 byte representation of a UUID.
this 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 Parse a UUID from its canonical string form. An UUID in its canonical form looks like this: 8ab3060e-2cba-4f23-b74c-b52db3bdfb46

Fields

Name Type Description
data ubyte[16] It is sometimes useful to get or set the 16 bytes of a UUID directly.

Properties

Name Type Description
empty [get] bool Returns true if and only if the UUID is equal to {00000000-0000-0000-0000-000000000000}
uuidVersion [get] UUID.Version RFC 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 the version used by this UUID.
variant [get] UUID.Variant RFC 4122 defines different internal data layouts for UUIDs. Returns the format used by this UUID.

Methods

Name Description
opCmp All of the standard numeric operators are defined for the UUID struct.
opEquals All of the standard numeric operators are defined for the UUID struct.
swap Swap the data of this UUID with the data of rhs.
toHash All of the standard numeric operators are defined for the UUID struct.
toString Return the UUID as a string in the canonical form.

Enums

Name Description
Variant RFC 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 this module will always be in rfc4122 format.
Version RFC 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.

Authors

Johannes Pfau

License

Boost License 1.0.

Comments