summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/new_uuid.cpp6
-rw-r--r--src/common/new_uuid.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/src/common/new_uuid.cpp b/src/common/new_uuid.cpp
index 0442681c8..f2f0077ae 100644
--- a/src/common/new_uuid.cpp
+++ b/src/common/new_uuid.cpp
@@ -144,6 +144,12 @@ size_t NewUUID::Hash() const noexcept {
144 return hash ^ std::rotl(temp, 1); 144 return hash ^ std::rotl(temp, 1);
145} 145}
146 146
147u128 NewUUID::AsU128() const {
148 u128 uuid_old;
149 std::memcpy(&uuid_old, uuid.data(), sizeof(NewUUID));
150 return uuid_old;
151}
152
147NewUUID NewUUID::MakeRandom() { 153NewUUID NewUUID::MakeRandom() {
148 std::random_device device; 154 std::random_device device;
149 155
diff --git a/src/common/new_uuid.h b/src/common/new_uuid.h
index bd4468ad2..44665ad5a 100644
--- a/src/common/new_uuid.h
+++ b/src/common/new_uuid.h
@@ -83,6 +83,9 @@ struct NewUUID {
83 */ 83 */
84 size_t Hash() const noexcept; 84 size_t Hash() const noexcept;
85 85
86 /// DO NOT USE. Copies the contents of the UUID into a u128.
87 u128 AsU128() const;
88
86 /** 89 /**
87 * Creates a default UUID "yuzu Default UID". 90 * Creates a default UUID "yuzu Default UID".
88 * 91 *