| 462 | return (rand() % (uMax - uMin)) + uMin; |
| 463 | } |
| 464 | std::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 | |
| 477 | std::string CFunctions::EncryptString(std::string szIn, const size_t size, BYTE byKey) |
| 478 | { |
no test coverage detected