From ea3c7301b1f7ff182afb263cebc7811a50c3b820 Mon Sep 17 00:00:00 2001 From: sspacelynx <37104290+sspacelynx@users.noreply.github.com> Date: Fri, 27 Aug 2021 19:23:20 +0200 Subject: [PATCH] Make `UUID::GenerateUuidV4` use `util::GetRandomBytes` --- app/src/main/cpp/skyline/common/uuid.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/app/src/main/cpp/skyline/common/uuid.cpp b/app/src/main/cpp/skyline/common/uuid.cpp index 6006578a..a5ce4e81 100644 --- a/app/src/main/cpp/skyline/common/uuid.cpp +++ b/app/src/main/cpp/skyline/common/uuid.cpp @@ -56,16 +56,9 @@ namespace skyline { constexpr u8 reserved{0x1}; // RFC4122 variant constexpr u8 version{0x4}; // v4 UUIDs are generated entirely from random numbers - std::random_device rd; - std::mt19937_64 gen(rd()); - - std::uniform_int_distribution dist; - // Create an initial random UUID - UuidLayout uuid{ - .low = dist(gen), - .high = dist(gen), - }; + UuidLayout uuid; + util::FillRandomBytes(span(&uuid, 1).cast()); // Set format bits uuid.reserved = reserved;