aboutsummaryrefslogtreecommitdiff
path: root/src/common/random.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/random.cpp')
-rw-r--r--src/common/random.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/common/random.cpp b/src/common/random.cpp
new file mode 100644
index 0000000000..d6865ee807
--- /dev/null
+++ b/src/common/random.cpp
@@ -0,0 +1,19 @@
+// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include <random>
+#include "common/random.h"
+
+static std::random_device g_random_device;
+
+namespace Common::Random {
+ [[nodiscard]] u32 Random32(u32 seed) noexcept {
+ return g_random_device();
+ }
+ [[nodiscard]] u64 Random64(u64 seed) noexcept {
+ return g_random_device();
+ }
+ [[nodiscard]] std::mt19937 GetMT19937() noexcept {
+ return std::mt19937(g_random_device());
+ }
+}