SNode.C
Loading...
Searching...
No Matches
utils::Uuid Class Reference

#include <Uuid.h>

Collaboration diagram for utils::Uuid:

Public Member Functions

 Uuid ()=delete
 
 Uuid (const Uuid &)=delete
 

Static Public Member Functions

static std::string getUuid ()
 

Detailed Description

Definition at line 31 of file Uuid.h.

Constructor & Destructor Documentation

◆ Uuid() [1/2]

utils::Uuid::Uuid ( )
delete

◆ Uuid() [2/2]

utils::Uuid::Uuid ( const Uuid & )
delete

Member Function Documentation

◆ getUuid()

std::string utils::Uuid::getUuid ( )
static

Definition at line 30 of file Uuid.cpp.

30 {
31 static std::random_device dev;
32 static std::mt19937 rng(dev());
33
34 std::uniform_int_distribution<int> dist(0, 15);
35
36 const char* v = "0123456789abcdef";
37 const bool dash[] = {false, false, false, false, true, false, true, false, true, false, true, false, false, false, false, false};
38
39 std::string res;
40 for (const bool isDash : dash) {
41 if (isDash) {
42 res += "-";
43 }
44 res += v[dist(rng)];
45 res += v[dist(rng)];
46 }
47 return res;
48 }

The documentation for this class was generated from the following files: