mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Speed up the random number generation
This commit is contained in:
parent
45638ccc91
commit
bb30d42b57
@ -87,10 +87,10 @@ std::vector<std::string> split(std::string str, char delimiter) {
|
||||
|
||||
|
||||
double random_number(const double from, const double to) {
|
||||
std::random_device rd;
|
||||
std::mt19937 mt(time(0));
|
||||
return std::bind(
|
||||
std::uniform_real_distribution<>{from, to},
|
||||
std::default_random_engine{ rd() })();
|
||||
std::default_random_engine{ mt() })();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user