mirror of
https://github.com/boostorg/uuid.git
synced 2026-01-19 04:42:16 +00:00
@@ -3,7 +3,7 @@
|
||||
|
||||
:idprefix: introduction_
|
||||
|
||||
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distributed environment without significant central coordination.
|
||||
A UUID, or universally unique identifier, is intended to uniquely identify information in a distributed environment without significant central coordination.
|
||||
It can be used to tag objects with very short lifetimes, or to reliably identify very persistent objects across a network.
|
||||
|
||||
A formal definition for UUID can be found in https://datatracker.ietf.org/doc/rfc4122/[RFC 4122] and https://datatracker.ietf.org/doc/rfc9562/[RFC 9562].
|
||||
@@ -18,7 +18,7 @@ UUIDs are inserted into documents from Microsoft Office programs.
|
||||
UUIDs identify audio or video streams in the Advanced Systems Format (ASF).
|
||||
UUIDs are also a basis for OIDs (object identifiers), and URNs (uniform resource name).
|
||||
|
||||
An attractive feature of UUIDs when compared to alternatives is their relative small size, of 128-bits, or 16-bytes.
|
||||
An attractive feature of UUIDs when compared to alternatives is their relative small size, of 128 bits, or 16 bytes.
|
||||
Another is that the creation of UUIDs does not require a centralized authority.
|
||||
|
||||
When UUIDs are generated by one of the defined mechanisms, they are either guaranteed to be unique, different from all other generated UUIDs
|
||||
|
||||
@@ -51,8 +51,8 @@ Returns: :: A name-based UUID version 5 produced from a digest of the namespace
|
||||
|
||||
Remarks: :: The characters of `name` are converted to a sequence of octets in the following manner:
|
||||
+
|
||||
* If `Ch` is `char` or `char8_t`, the characters are processed as octets directly;
|
||||
* If `Ch` is `wchar_t`, the characters are converted to `uint32_t` and then serialized to four octets each using little-endian representation;
|
||||
* If `Ch` is `char` or `char8_t`, the characters are processed as octets directly.
|
||||
* If `Ch` is `wchar_t`, the characters are converted to `uint32_t` and then serialized to four octets each using little-endian representation.
|
||||
* Otherwise, the character sequence is converted to UTF-8 and the result is processed as octets.
|
||||
|
||||
Example: ::
|
||||
|
||||
@@ -63,7 +63,7 @@ The atomic state is used by the generators to ensure that no duplicate UUIDs are
|
||||
time_generator_v1();
|
||||
```
|
||||
|
||||
Effects: :: Using entropy from `std::random_device`, generates a pseudorandom 48 bit node identifier in `node_` and a pseudorandom 14 bit clock sequence in `state_.clock_seq`. Initalizes `state_.timestamp` to zero.
|
||||
Effects: :: Using entropy from `std::random_device`, generates a pseudorandom 48 bit node identifier in `node_` and a pseudorandom 14 bit clock sequence in `state_.clock_seq`. Initializes `state_.timestamp` to zero.
|
||||
|
||||
Remarks: :: The multicast bit of `node_` is set to denote a local node identifier, as recommended in https://www.rfc-editor.org/rfc/rfc4122.html#section-4.5[RFC 4122 Section 4.5].
|
||||
|
||||
|
||||
@@ -97,6 +97,6 @@ Effects: ::
|
||||
|
||||
Remarks: :: `operator()` generates a monotonically increasing sequence of UUIDs, if the following requirements are met:
|
||||
+
|
||||
* The system clock never goes backwards;
|
||||
* The system clock has at least millisecond resolution;
|
||||
* No more than 64 UUIDs are generated per microsecond (no more than one every 16 nanoseconds.)
|
||||
* The system clock never goes backwards.
|
||||
* The system clock has at least millisecond resolution.
|
||||
* No more than 64 UUIDs are generated per microsecond (no more than one every 16 nanoseconds).
|
||||
|
||||
@@ -47,7 +47,7 @@ These values are specified in https://www.rfc-editor.org/rfc/rfc4122.html#sectio
|
||||
static time_point now() noexcept;
|
||||
```
|
||||
|
||||
Returns: :: The current system time (`std::chrono::system_clock::now()`, converted to `uuid_clock::time_point`.)
|
||||
Returns: :: The current system time (`std::chrono::system_clock::now()`, converted to `uuid_clock::time_point`).
|
||||
|
||||
=== from_sys
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ template<class Ch>
|
||||
bool to_chars( uuid const& u, Ch* first, Ch* last ) noexcept;
|
||||
```
|
||||
|
||||
Requires: :: `Ch` must be a character type (one of `char`, `wchar_t`, `char8_t`, `char16_t`, `char32_t`.)
|
||||
Requires: :: `Ch` must be a character type (one of `char`, `wchar_t`, `char8_t`, `char16_t`, `char32_t`).
|
||||
|
||||
Effects: :: If `last - first >= 36`, writes the string representation of `u` (exactly 36 characters, not null terminated) into the buffer starting at `first` and returns `true`. Otherwise, returns `false`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user