10 #ifndef OPENSHOT_ID_GENERATOR_H
11 #define OPENSHOT_ID_GENERATOR_H
20 static inline std::string
Generate(
int length = 8) {
21 static const char charset[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
22 std::random_device rd;
23 std::mt19937 gen(rd());
24 std::uniform_int_distribution<> dist(0,
static_cast<int>(
sizeof(charset) - 2));
27 result.reserve(length);
28 for (
int i = 0; i < length; ++i)
29 result += charset[dist(gen)];
static std::string Generate(int length=8)
This namespace is the default namespace for all code in the openshot library.