UiXmlReader update

This commit is contained in:
MihailRis
2024-02-05 01:10:05 +03:00
parent b38afe9e34
commit 4fd398844e
6 changed files with 103 additions and 46 deletions
+8
View File
@@ -228,6 +228,14 @@ std::string util::base64_encode(const ubyte* data, size_t size) {
return ss.str();
}
std::string util::mangleid(uint64_t value) {
// todo: use base64
std::stringstream ss;
ss << std::hex << value;
std::string result(ss.str());
return ss.str();
}
std::vector<ubyte> util::base64_decode(const char* str, size_t size) {
std::vector<ubyte> bytes((size/4)*3);
ubyte* dst = bytes.data();
+2
View File
@@ -27,6 +27,8 @@ namespace util {
extern std::vector<ubyte> base64_decode(const char* str, size_t size);
extern std::vector<ubyte> base64_decode(const std::string& str);
extern std::string mangleid(uint64_t value);
extern int replaceAll(std::string& str, const std::string& from, const std::string& to);
extern double parse_double(const std::string& str);