aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorlizzie <lizzie@eden-emu.dev>2026-08-04 01:50:54 +0200
committercrueter <crueter@eden-emu.dev>2026-08-04 01:50:54 +0200
commit8fe1e6efa2fe21abc9e8e1f83ecbc5a78389e37b (patch)
treed09c3210519fda784e30d2754baf21dd4db8324d /src/common
parentee197e622216e85753512ed79e9242442a312544 (diff)
[core/file_sys] implement IApplicationFunctions::GetPseudoDeviceId; common PatchManager::GetNACP for base|updates (#4159)
a bit of refactoring so there's less code duplication... probably a good idea to make it a lambda anyways maybe this is why QLauncher didn't have proper DLCs and updates? either way "GetPseudoDeviceId" is now implemented (still stubbed) with a proper hash instead of just 0 Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4159 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Diffstat (limited to 'src/common')
-rw-r--r--src/common/uuid.cpp8
-rw-r--r--src/common/uuid.h36
2 files changed, 24 insertions, 20 deletions
diff --git a/src/common/uuid.cpp b/src/common/uuid.cpp
index d4a5733c26..51fe0abaa5 100644
--- a/src/common/uuid.cpp
+++ b/src/common/uuid.cpp
@@ -208,4 +208,12 @@ UUID UUID::MakeRandomRFC4122V4() {
return uuid;
}
+UUID UUID::MakeRFC4122V5(std::span<u8, 20> sha1) {
+ UUID uuid{};
+ std::memcpy(&uuid.uuid, sha1.data(), sizeof(UUID));
+ uuid.uuid[8] = 0x80 | (uuid.uuid[8] & 0x3F);
+ uuid.uuid[6] = 0x50 | (uuid.uuid[6] & 0xF);
+ return uuid;
+}
+
} // namespace Common
diff --git a/src/common/uuid.h b/src/common/uuid.h
index 60c5d75f12..c3cbd7b479 100644
--- a/src/common/uuid.h
+++ b/src/common/uuid.h
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
+
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -5,6 +8,7 @@
#include <array>
#include <functional>
+#include <span>
#include <string>
#include "common/common_types.h"
@@ -86,28 +90,20 @@ struct UUID {
};
}
- /**
- * Creates a random UUID.
- *
- * @returns A random UUID.
- */
- static UUID MakeRandom();
+ /// @brief Creates a random UUID.
+ /// @returns A random UUID.
+ [[nodiscard]] static UUID MakeRandom();
- /**
- * Creates a random UUID with a seed.
- *
- * @param seed A seed to initialize the Mersenne-Twister RNG
- *
- * @returns A random UUID.
- */
- static UUID MakeRandomWithSeed(u32 seed);
+ /// @brief Creates a random UUID with a seed.
+ /// @param seed A seed to initialize the Mersenne-Twister RNG
+ /// @returns A random UUID.
+ [[nodiscard]] static UUID MakeRandomWithSeed(u32 seed);
- /**
- * Creates a random UUID. The generated UUID is RFC 4122 Version 4 compliant.
- *
- * @returns A random UUID that is RFC 4122 Version 4 compliant.
- */
- static UUID MakeRandomRFC4122V4();
+ /// @brief Creates a random UUID. The generated UUID is RFC 4122 Version 4 compliant.
+ /// @returns A random UUID that is RFC 4122 Version 4 compliant.
+ [[nodiscard]] static UUID MakeRandomRFC4122V4();
+
+ [[nodiscard]] static UUID MakeRFC4122V5(std::span<u8, 20> sha1);
friend constexpr bool operator==(const UUID& lhs, const UUID& rhs) = default;
};