12 lines
338 B
C++
12 lines
338 B
C++
#include "utils.h"
|
|
|
|
std::string utils::randomizeString(size_t length)
|
|
{
|
|
const char charset[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
std::string result;
|
|
result.resize(length);
|
|
for (size_t i = 0; i < length; ++i)
|
|
result[i] = charset[rand() % (sizeof(charset) - 1)];
|
|
return result;
|
|
}
|