Yarilo
v0.9.9
WPA2 Decrypter & Packet Analyzer
Loading...
Searching...
No Matches
uuid.h
Go to the documentation of this file.
1
#ifndef SNIFF_UUID
2
#define SNIFF_UUID
3
4
#include <random>
5
#include <sstream>
6
7
namespace
yarilo
{
8
9
namespace
uuid {
10
11
typedef
std::string
UUIDv4
;
12
13
static
std::random_device rd;
14
static
std::mt19937 gen(rd());
15
static
std::uniform_int_distribution<> dis(0, 15);
16
static
std::uniform_int_distribution<> dis2(8, 11);
17
18
inline
std::string
generate_v4
() {
19
std::stringstream ss;
20
int
i;
21
ss << std::hex;
22
for
(i = 0; i < 8; i++) {
23
ss << dis(gen);
24
}
25
ss <<
"-"
;
26
for
(i = 0; i < 4; i++) {
27
ss << dis(gen);
28
}
29
ss <<
"-4"
;
30
for
(i = 0; i < 3; i++) {
31
ss << dis(gen);
32
}
33
ss <<
"-"
;
34
ss << dis2(gen);
35
for
(i = 0; i < 3; i++) {
36
ss << dis(gen);
37
}
38
ss <<
"-"
;
39
for
(i = 0; i < 12; i++) {
40
ss << dis(gen);
41
};
42
return
ss.str();
43
}
44
45
}
// namespace uuid
46
47
}
// namespace yarilo
48
49
#endif SNIFF_UUID
yarilo::uuid::UUIDv4
std::string UUIDv4
Definition
uuid.h:11
yarilo::uuid::generate_v4
std::string generate_v4()
Definition
uuid.h:18
yarilo
Definition
access_point.cpp:22
src
uuid.h
Generated by
1.10.0