Lines Matching refs:uuid
121 bool GetBufferedUUID(napi_env env, UUID &uuid)
125 napi_throw_error(env, "-1", "uuid generate failed");
129 if (memcpy_s(uuid.elements, UUID_SIZE, g_uuidCache + uuidCachedIndex * UUID_SIZE, UUID_SIZE) != EOK) {
130 napi_throw_error(env, "-1", "uuid generate failed");
133 ProcessUUID(uuid.elements);
138 bool GetUnBufferedUUID(napi_env env, UUID &uuid)
140 if (!GenerateUUID(uuid.elements, UUID_SIZE)) {
141 napi_throw_error(env, "-1", "uuid generate failed");
144 ProcessUUID(uuid.elements);
148 bool GetUUID(napi_env env, bool entropyCache, UUID &uuid)
150 return entropyCache ? GetBufferedUUID(env, uuid) : GetUnBufferedUUID(env, uuid);
155 UUID uuid;
157 if (!GetUUID(env, entropyCache, uuid)) {
160 uuidString = GetFormatUUID(uuid);
165 std::string GetFormatUUID(const UUID &uuid)
168 for (size_t i = 0; i < sizeof(uuid.elements); i++) {
169 unsigned char value = uuid.elements[i];
186 UUID uuid;
187 if (!GetUUID(env, entropyCache, uuid)) {
192 size_t bufferSize = sizeof(uuid.elements);
194 if (memcpy_s(data, bufferSize, uuid.elements, bufferSize) != EOK) {
195 HILOG_ERROR("get uuid memcpy_s failed");