feat: add randomizeString

This commit is contained in:
2026-06-19 01:09:30 -03:00
parent d2263e0839
commit 2c23b25a1d
2 changed files with 19 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
#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;
}
+8
View File
@@ -0,0 +1,8 @@
#pragma once
#include <string>
namespace utils
{
std::string randomizeString(size_t length);
}