1#include <random>
2#include <string>
3
4std::string random_string()
5{
6 std::string str("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
7
8 std::random_device rd;
9 std::mt19937 generator(rd());
10
11 std::shuffle(str.begin(), str.end(), generator);
12
13 return str.substr(0, 32); // assumes 32 < number of characters in str
14}
15