mirror of
https://github.com/anope/anope.git
synced 2026-06-27 05:46: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:
@@ -22,7 +22,7 @@ class EBCRYPT final
|
||||
{
|
||||
char entropy[16];
|
||||
for (auto &chr : entropy)
|
||||
chr = static_cast<char>(rand() % 0xFF);
|
||||
chr = static_cast<char>(Anope::RandomNumber() % 0xFF);
|
||||
|
||||
char salt[32];
|
||||
if (!_crypt_gensalt_blowfish_rn("$2a$", rounds, entropy, sizeof(entropy), salt, sizeof(salt)))
|
||||
|
||||
Reference in New Issue
Block a user