mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-13 15:07:01 +03:00
big merge
This commit is contained in:
20
components/spotify/cspot/bell/src/BellUtils.cpp
Normal file
20
components/spotify/cspot/bell/src/BellUtils.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "BellUtils.h"
|
||||
|
||||
std::string bell::generateRandomUUID() {
|
||||
static std::random_device dev;
|
||||
static std::mt19937 rng(dev());
|
||||
|
||||
std::uniform_int_distribution<int> dist(0, 15);
|
||||
|
||||
const char *v = "0123456789abcdef";
|
||||
const bool dash[] = {0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0};
|
||||
|
||||
std::string res;
|
||||
for (int i = 0; i < 16; i++) {
|
||||
if (dash[i])
|
||||
res += "-";
|
||||
res += v[dist(rng)];
|
||||
res += v[dist(rng)];
|
||||
}
|
||||
return res;
|
||||
}
|
||||
Reference in New Issue
Block a user