#include "tools.h" #include #include namespace Yc { namespace Lib { Tools::Tools() { } std::string Tools::generateRandomString(size_t length) { std::string choices( "0123456789" "`~!@#$%^&*()-_=+[{]}|\\:;<,>./?" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ); std::random_device random; std::mt19937 generator(random()); std::uniform_int_distribution distribution(0, choices.size()); std::string result(length, '0'); for (size_t i = 0; i < length; ++i) { result[i] = choices[distribution(generator)]; } return result; } } // namespace Lib } // namespace Yp