TODO(cmasone): Once we're comfortable this works, migrate Windows code to use this as well.
| 17 | // TODO(cmasone): Once we're comfortable this works, migrate Windows code to |
| 18 | // use this as well. |
| 19 | std::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 |