| 32 | } |
| 33 | |
| 34 | void GenRandomString(char *s, const int len) { |
| 35 | static const char alpha_num[] = |
| 36 | "0123456789" |
| 37 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
| 38 | "abcdefghijklmnopqrstuvwxyz"; |
| 39 | |
| 40 | srand(time(nullptr)); |
| 41 | for (int i = 0; i < len; ++i) { |
| 42 | s[i] = alpha_num[rand() % (sizeof(alpha_num) - 1)]; |
| 43 | } |
| 44 | |
| 45 | s[len] = '\0'; |
| 46 | } |
| 47 | |
| 48 | int main(int argc, char **argv) { |
| 49 | const char *module_name{program_invocation_short_name}; |