#include "utils.h" std::string Shared::getISOTimestamp() { std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); std::chrono::time_point time = std::chrono::floor(now); return std::format("{:%FT%TZ}", time); } std::string Shared::getUUID() { uuid_t uuid; uuid_generate_random(uuid); char uuid_str[37]; uuid_unparse_lower(uuid, uuid_str); return std::string(uuid_str); } Shared::Strings Shared::split(const std::string& string, const std::string& delimiter) { Strings result; std::size_t last = 0; std::size_t next = string.find(delimiter, last); while (next != std::string::npos) { result.emplace_back(string.substr(last, next - last)); last = next + 1; next = string.find(delimiter, last); } result.emplace_back(string.substr(last)); return result; }