15#ifndef ACTIONENGINE_UTIL_RANDOM_H_ 
   16#define ACTIONENGINE_UTIL_RANDOM_H_ 
   22#include <absl/random/distributions.h> 
   23#include <absl/random/random.h> 
   27inline std::string GenerateUUID4() {
 
   32  std::array<uint8_t, 16> bytes{};
 
   33  for (
int i = 0; i < 16; ++i) {
 
   34    bytes[i] = absl::Uniform<int>(gen, 0, 256);  
 
   38  bytes[6] = (bytes[6] & 0x0f) | 0x40;
 
   41  bytes[8] = (bytes[8] & 0x3f) | 0x80;
 
   44  std::ostringstream oss;
 
   45  for (
size_t i = 0; i < bytes.size(); ++i) {
 
   46    if (i == 4 || i == 6 || i == 8 || i == 10) {
 
   49    oss << std::hex << std::setw(2) << std::setfill(
'0')
 
   50        << 
static_cast<int>(bytes[i]);