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 53 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 52 of file Uuid.cpp.

52 {
53 static std::random_device dev;
54 static std::mt19937 rng(dev());
55
56 std::uniform_int_distribution<int> dist(0, 15);
57
58 const char* v = "0123456789abcdef";
59 const bool dash[] = {false, false, false, false, true, false, true, false, true, false, true, false, false, false, false, false};
60
61 std::string res;
62 for (const bool isDash : dash) {
63 if (isDash) {
64 res += "-";
65 }
66 res += v[dist(rng)];
67 res += v[dist(rng)];
68 }
69 return res;
70 }

Referenced by net::un::config::ConfigAddress< ConfigAddressTypeT >::ConfigAddress(), and iot::mqtt::server::packets::Connect::deserializeVP().

Here is the caller graph for this function:

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