Lines Matching refs:uuid
62 std::optional<Uuid> Uuid::FromString(const std::string& uuid) { in FromString() argument
63 if (uuid.empty()) { in FromString()
69 if (uuid.size() == kString128BitLen) { in FromString()
70 if (uuid[8] != '-' || uuid[13] != '-' || uuid[18] != '-' || uuid[23] != '-') { in FromString()
76 uuid.c_str(), in FromString()
103 } else if (uuid.size() == 8) { in FromString()
105 int rc = sscanf(uuid.c_str(), "%02hhx%02hhx%02hhx%02hhx%n", &p[0], &p[1], &p[2], &p[3], &c); in FromString()
113 } else if (uuid.size() == 4) { in FromString()
115 int rc = sscanf(uuid.c_str(), "%02hhx%02hhx%n", &p[2], &p[3], &c); in FromString()
129 std::optional<Uuid> Uuid::FromLegacyConfigString(const std::string& uuid) { in FromLegacyConfigString() argument
130 return FromString(uuid); in FromLegacyConfigString()
151 Uuid Uuid::From128BitBE(const uint8_t* uuid) { in From128BitBE() argument
153 memcpy(tmp.data(), uuid, kNumBytes128); in From128BitBE()
157 Uuid Uuid::From128BitLE(const UUID128Bit& uuid) { in From128BitLE() argument
159 std::reverse_copy(uuid.data(), uuid.data() + kNumBytes128, u.uu.begin()); in From128BitLE()
163 Uuid Uuid::From128BitLE(const uint8_t* uuid) { in From128BitLE() argument
165 memcpy(tmp.data(), uuid, kNumBytes128); in From128BitLE()
180 Uuid uuid; in GetRandom() local
181 RAND_bytes(uuid.uu.data(), uuid.uu.size()); in GetRandom()
182 return uuid; in GetRandom()