MCPcopy Create free account
hub / github.com/apache/brpc / RandomDataToGUIDString

Function RandomDataToGUIDString

src/butil/guid_posix.cc:19–26  ·  view source on GitHub ↗

TODO(cmasone): Once we're comfortable this works, migrate Windows code to use this as well.

Source from the content-addressed store, hash-verified

17// TODO(cmasone): Once we're comfortable this works, migrate Windows code to
18// use this as well.
19std::string RandomDataToGUIDString(const uint64_t bytes[2]) {
20 return StringPrintf("%08X-%04X-%04X-%04X-%012llX",
21 static_cast<unsigned int>(bytes[0] >> 32),
22 static_cast<unsigned int>((bytes[0] >> 16) & 0x0000ffff),
23 static_cast<unsigned int>(bytes[0] & 0x0000ffff),
24 static_cast<unsigned int>(bytes[1] >> 48),
25 bytes[1] & 0x0000ffffffffffffULL);
26}
27
28} // namespace guid

Callers 2

TESTFunction · 0.85
GenerateGUIDFunction · 0.85

Calls 1

StringPrintfFunction · 0.85

Tested by 1

TESTFunction · 0.68