| 29 | namespace |
| 30 | { |
| 31 | std::string generateRandomString(size_t length, pcg64 & rng) |
| 32 | { |
| 33 | if (length == 0) |
| 34 | return ""; |
| 35 | |
| 36 | static const auto & chars = "0123456789" |
| 37 | "abcdefghijklmnopqrstuvwxyz" |
| 38 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; |
| 39 | |
| 40 | std::uniform_int_distribution<size_t> pick(0, sizeof(chars) - 2); |
| 41 | |
| 42 | std::string s; |
| 43 | |
| 44 | s.reserve(length); |
| 45 | |
| 46 | while (length--) |
| 47 | s += chars[pick(rng)]; |
| 48 | |
| 49 | return s; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | NumberGetter |