#include "utils.h" #include #include std::string utils::getExePath() { char buffer[MAX_PATH]; GetModuleFileNameA(NULL, buffer, MAX_PATH); std::string path(buffer); size_t pos = path.find_last_of("\\/"); if (pos != std::string::npos) return path.substr(0, pos + 1); return ""; } 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; }