diff --git a/src/unlocker/utils.cpp b/src/unlocker/utils.cpp new file mode 100644 index 0000000..a0dd62a --- /dev/null +++ b/src/unlocker/utils.cpp @@ -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; +} diff --git a/src/unlocker/utils.h b/src/unlocker/utils.h new file mode 100644 index 0000000..dac0119 --- /dev/null +++ b/src/unlocker/utils.h @@ -0,0 +1,8 @@ +#pragma once + +#include + +namespace utils +{ + std::string randomizeString(size_t length); +}