add util::base64_urlsafe_encode/decode

This commit is contained in:
MihailRis
2025-03-12 16:26:46 +03:00
parent 65ca46b2da
commit 4cdb1fbae2
3 changed files with 98 additions and 18 deletions
+8
View File
@@ -74,8 +74,12 @@ namespace util {
std::wstring to_wstring(double x, int precision);
std::string base64_encode(const ubyte* data, size_t size);
std::string base64_urlsafe_encode(const ubyte* data, size_t size);
util::Buffer<ubyte> base64_decode(const char* str, size_t size);
util::Buffer<ubyte> base64_urlsafe_decode(const char* str, size_t size);
util::Buffer<ubyte> base64_decode(std::string_view str);
util::Buffer<ubyte> base64_urlsafe_decode(std::string_view str);
std::string tohex(uint64_t value);
@@ -85,6 +89,10 @@ namespace util {
std::string& str, const std::string& from, const std::string& to
);
int replaceAll(
std::wstring& str, const std::wstring& from, const std::wstring& to
);
double parse_double(const std::string& str);
double parse_double(const std::string& str, size_t offset, size_t len);