44 thread_local static std::mt19937 gen{std::random_device{}()};
54 std::uniform_int_distribution<std::size_t> dist(0, n - 1);
69 static auto& chrs =
"0123456789"
70 "abcdefghijklmnopqrstuvwxyz"
71 "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
73 thread_local static std::uniform_int_distribution<std::string::size_type> pick(0,
sizeof(chrs) - 2);
Collects random number generation tools for multithreaded environments. It includes a default thread-...
Definition generators.hpp:32
std::mt19937 & default_generator()
Returns a reference to a thread-local std::mt19937 random number generator.
Definition generators.hpp:40
std::size_t random_number(const std::size_t n, std::mt19937 &gen=default_generator())
Returns a random number in the range [0, n-1].
Definition generators.hpp:52
std::string random_string(std::string::size_type length, std::mt19937 &gen=default_generator())
Generates a random string of specified length.
Definition generators.hpp:67