| 21 | int GenerateRandomNumber(int max) { return std::rand() % max; } |
| 22 | |
| 23 | std::string CreateRandomString(int32_t index) { |
| 24 | static const size_t len = 1024; |
| 25 | char bytes[len]; |
| 26 | size_t i = 0; |
| 27 | while (i < 8) { |
| 28 | bytes[i] = 'a' + ((index >> (4 * i)) & 0xf); |
| 29 | ++i; |
| 30 | } |
| 31 | while (i < sizeof(bytes)) { |
| 32 | bytes[i] = 'a' + GenerateRandomNumber(26); |
| 33 | ++i; |
| 34 | } |
| 35 | return std::string(bytes, sizeof(bytes)); |
| 36 | } |
| 37 | |
| 38 | } // namespace |
| 39 |
no test coverage detected