This commit is contained in:
yhirose 2021-02-17 15:36:56 -05:00
parent cf475bcb50
commit ff813bf99d

View file

@ -3775,7 +3775,7 @@ inline std::string random_string(size_t length) {
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
const size_t max_index = (sizeof(charset) - 1);
return charset[static_cast<size_t>(rand()) % max_index];
return charset[static_cast<size_t>(std::rand()) % max_index];
};
std::string str(length, 0);
std::generate_n(str.begin(), length, randchar);