diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2018-06-08 00:41:08 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-08 00:41:08 +0900 |
| commit | de0fe0e210ad72b6ef10afa5e092d486de578557 (patch) | |
| tree | 5e59440206a80f70d310a129ac05171900e21b42 /Source/Core/Common/Network.cpp | |
| parent | b51fbaa5b084edc638b66ebd3be8093f4887ee14 (diff) | |
| parent | fff1db973096a893475f3ec96ee6f28e35c4a67c (diff) | |
Merge pull request #6928 from leoetlino/random
Common: Add Random utilities
Diffstat (limited to 'Source/Core/Common/Network.cpp')
| -rw-r--r-- | Source/Core/Common/Network.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Source/Core/Common/Network.cpp b/Source/Core/Common/Network.cpp index f492efd5ae..1d95e0c8a4 100644 --- a/Source/Core/Common/Network.cpp +++ b/Source/Core/Common/Network.cpp @@ -5,11 +5,10 @@ #include <cctype> #include <cstring> #include <ctime> -#include <random> #include "Common/Network.h" +#include "Common/Random.h" #include "Common/StringUtil.h" -#include "Common/Timer.h" namespace Common { @@ -31,11 +30,7 @@ void GenerateMacAddress(const MACConsumer type, u8* mac) } // Generate the 24-bit NIC-specific portion of the MAC address. - std::default_random_engine generator(Common::Timer::GetTimeMs()); - std::uniform_int_distribution<int> distribution(0x00, 0xFF); - mac[3] = static_cast<u8>(distribution(generator)); - mac[4] = static_cast<u8>(distribution(generator)); - mac[5] = static_cast<u8>(distribution(generator)); + Common::Random::Generate(&mac[3], 3); } std::string MacAddressToString(const u8* mac) |
