Faster base64 (#63)

Cool kids on the Internet use two tables to do base64. That looks cool.
We should get it.
This commit is contained in:
Mingye Wang authored and GitHub committed 2020-02-16 22:42:48 +08:00
1 parent b0b2546d93
commit 0e7ba4e401
2 files changed
+37 -16

No files matched your search

+3 -1
View File
@@ -13,6 +13,7 @@
#define PATH_SLASH "//"
#endif // _WIN32
typedef std::string::size_type string_size;
typedef std::vector<std::string> string_array;
typedef const std::string &refCnstStr;
@@ -23,12 +24,13 @@ static const std::string base64_chars =
std::string UrlEncode(const std::string& str);
std::string UrlDecode(const std::string& str);
std::string base64_decode(const std::string &encoded_string);
std::string base64_decode(const std::string &encoded_string, bool accept_urlsafe = false);
std::string base64_encode(const std::string &string_to_encode);
std::vector<std::string> split(const std::string &s, const std::string &seperator);
std::string getUrlArg(const std::string &url, const std::string &request);
std::string replace_all_distinct(std::string str, const std::string &old_value, const std::string &new_value);
std::string urlsafe_base64(const std::string &encoded_string);
std::string urlsafe_base64_reverse(const std::string &encoded_string);
std::string urlsafe_base64_decode(const std::string &encoded_string);
std::string urlsafe_base64_encode(const std::string &string_to_encode);