mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-04 09:16:47 +00:00
moves base64 code into websocketpp namespace
This commit is contained in:
@@ -38,7 +38,9 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
static const std::string base64_chars =
|
||||
namespace websocketpp {
|
||||
|
||||
static std::string const base64_chars =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
"abcdefghijklmnopqrstuvwxyz"
|
||||
"0123456789+/";
|
||||
@@ -50,7 +52,7 @@ static inline bool is_base64(unsigned char c) {
|
||||
(c >= 97 && c <= 122)); // a-z
|
||||
}
|
||||
|
||||
inline std::string base64_encode(unsigned char const* bytes_to_encode, unsigned
|
||||
inline std::string base64_encode(unsigned char const * bytes_to_encode, unsigned
|
||||
int in_len)
|
||||
{
|
||||
std::string ret;
|
||||
@@ -100,11 +102,11 @@ inline std::string base64_encode(unsigned char const* bytes_to_encode, unsigned
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline std::string base64_encode(const std::string & data) {
|
||||
inline std::string base64_encode(std::string const & data) {
|
||||
return base64_encode(reinterpret_cast<const unsigned char *>(data.data()),data.size());
|
||||
}
|
||||
|
||||
inline std::string base64_decode(std::string const& encoded_string) {
|
||||
inline std::string base64_decode(std::string const & encoded_string) {
|
||||
size_t in_len = encoded_string.size();
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
@@ -149,4 +151,6 @@ inline std::string base64_decode(std::string const& encoded_string) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // namespace websocketpp
|
||||
|
||||
#endif // _BASE64_HPP_
|
||||
|
||||
Reference in New Issue
Block a user