1
2
3
4
5
6 #include <soulng/util/Uuid.hpp>
7
8 namespace soulng { namespace util {
9
10 void UuidToInts(const boost::uuids::uuid& id, uint64_t& int1, uint64_t& int2)
11 {
12 #ifndef NDEBUG
13
14 #endif
15 const uint8_t* i = id.begin();
16 const uint64_t* i64 = reinterpret_cast<const uint64_t*>(i);
17 int1 = *i64++;
18 int2 = *i64;
19 }
20
21 void IntsToUuid(uint64_t int1, uint64_t int2, boost::uuids::uuid& id)
22 {
23 #ifndef NDEBUG
24
25 #endif
26 uint8_t* i = id.begin();
27 uint64_t* i64 = reinterpret_cast<uint64_t*>(i);
28 *i64++ = int1;
29 *i64 = int2;
30 }
31
32 } }