MCPcopy Create free account
hub / github.com/NoMercy-ac/NoMercy / GetRandomString

Method GetRandomString

Source/Client/NM_Engine/Functions.cpp:464–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462 return (rand() % (uMax - uMin)) + uMin;
463}
464std::string CFunctions::GetRandomString(int iLength)
465{
466 CHAR __alphabet[] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 0x0 }; // abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
467 static std::string charset = __alphabet;
468 std::string result;
469 result.resize(iLength);
470
471 for (int i = 0; i < iLength; i++)
472 result[i] = charset[rand() % charset.length()];
473
474 return result;
475}
476
477std::string CFunctions::EncryptString(std::string szIn, const size_t size, BYTE byKey)
478{

Callers 1

RandomApiCheckFunction · 0.80

Calls 1

lengthMethod · 0.45

Tested by

no test coverage detected