mirror of
https://github.com/anope/anope.git
synced 2026-06-28 01:36:37 +02:00
Use the C++11 random number generator instead of rand().
This is safer, faster, and doesn't require seeding.
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user