diff --git a/deps/ox/src/ox/std/uuid.cpp b/deps/ox/src/ox/std/uuid.cpp index df080d99..89f5be52 100644 --- a/deps/ox/src/ox/std/uuid.cpp +++ b/deps/ox/src/ox/std/uuid.cpp @@ -25,7 +25,9 @@ Result UUID::generate() noexcept { } UUID out; for (auto &v : out.m_value) { - v = static_cast(s_rand.gen() % 255); + // shift away 4 lowest bits, as Xoroshiro128+ randomness is weaker there + const auto rand = s_rand.gen() >> 4; + v = static_cast(rand % 255); } out.m_value[6] &= 0x0f; out.m_value[6] |= 4 << 4;