diff options
| author | lizzie <lizzie@eden-emu.dev> | 2026-03-31 20:12:41 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2026-03-31 20:12:41 +0200 |
| commit | ee2891c55e0386ae803aa4d09a4e3110db3143ef (patch) | |
| tree | 07384946edd6f4fbbd7527190f07b48bd305d940 /src/common/uuid.cpp | |
| parent | dd91b41a786a4d0402935f171f2f37e2e7ba5556 (diff) | |
[common] unify std::random_device (#3801)
Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3801
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
Diffstat (limited to 'src/common/uuid.cpp')
| -rw-r--r-- | src/common/uuid.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/common/uuid.cpp b/src/common/uuid.cpp index 8f0dba452c..d4a5733c26 100644 --- a/src/common/uuid.cpp +++ b/src/common/uuid.cpp @@ -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 @@ -10,6 +13,7 @@ #include "common/assert.h" #include "common/tiny_mt.h" #include "common/uuid.h" +#include "common/random.h" namespace Common { @@ -175,21 +179,16 @@ u128 UUID::AsU128() const { } UUID UUID::MakeRandom() { - std::random_device device; - - return MakeRandomWithSeed(device()); + return MakeRandomWithSeed(Common::Random::Random32(0)); } UUID UUID::MakeRandomWithSeed(u32 seed) { // Create and initialize our RNG. TinyMT rng; rng.Initialize(seed); - UUID uuid; - // Populate the UUID with random bytes. rng.GenerateRandomBytes(uuid.uuid.data(), sizeof(UUID)); - return uuid; } |
