| 4 | { |
| 5 | |
| 6 | std::vector<uint8_t> randomBytes(std::size_t length) |
| 7 | { |
| 8 | static std::mutex mtx; |
| 9 | std::lock_guard<std::mutex> lock(mtx); |
| 10 | |
| 11 | static std::mt19937 gen{std::random_device{}()}; |
| 12 | |
| 13 | std::uniform_int_distribution<uint16_t> dist(0, 255); |
| 14 | |
| 15 | std::vector<uint8_t> data(length); |
| 16 | for (auto &b : data) |
| 17 | { |
| 18 | b = static_cast<uint8_t>(dist(gen)); |
| 19 | } |
| 20 | |
| 21 | return data; |
| 22 | } |
| 23 | |
| 24 | std::string randomString(size_t length) |
| 25 | { |
nothing calls this directly
no outgoing calls
no test coverage detected