1
0
mirror of https://github.com/anope/anope.git synced 2026-07-03 15:13:14 +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:
Sadie Powell
2024-03-07 21:56:58 +00:00
parent 3272c1bbc6
commit 464e6b8010
12 changed files with 21 additions and 29 deletions
+1 -1
View File
@@ -249,7 +249,7 @@ class ESHA256 final
void NewRandomIV()
{
for (auto &ivsegment : iv)
ivsegment = static_cast<uint32_t>(rand());
ivsegment = static_cast<uint32_t>(Anope::RandomNumber());
}
/* returns the IV as base64-encrypted string */