summaryrefslogtreecommitdiff
path: root/src/nickcore.cpp
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-03-07 21:56:58 +0000
committerSadie Powell <sadie@witchery.services>2024-03-07 22:52:41 +0000
commit464e6b8010c11708bcbed7cf6b2d972977f0e286 (patch)
tree0adee0c876aee23acb1e16e2195df90500ff6e65 /src/nickcore.cpp
parent3272c1bbc65eaa29ba63e176ec76702c5b21d367 (diff)
Use the C++11 random number generator instead of rand().
This is safer, faster, and doesn't require seeding.
Diffstat (limited to 'src/nickcore.cpp')
-rw-r--r--src/nickcore.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nickcore.cpp b/src/nickcore.cpp
index 939f224db..77f4aaddf 100644
--- a/src/nickcore.cpp
+++ b/src/nickcore.cpp
@@ -224,7 +224,7 @@ uint64_t NickCore::GetId()
// Generate a random key for SipHash.
char key[16];
for (auto &chr : key)
- chr = rand() % CHAR_MAX;
+ chr = Anope::RandomNumber() % CHAR_MAX;
uint64_t newid = Anope::SipHash24(secretid.c_str(), secretid.length(), key);
nickcoreid_map::const_iterator it = NickCoreIdList.find(newid);