mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
adds convenience method to base64 encode strings
This commit is contained in:
@@ -50,6 +50,10 @@ static inline bool is_base64(unsigned char c) {
|
||||
(c >= 97 && c <= 122)); // a-z
|
||||
}
|
||||
|
||||
inline std::string base64_encode(const std::string & data) {
|
||||
return base64_encode(data.data(),data.size());
|
||||
}
|
||||
|
||||
inline std::string base64_encode(unsigned char const* bytes_to_encode, unsigned
|
||||
int in_len)
|
||||
{
|
||||
@@ -145,4 +149,4 @@ inline std::string base64_decode(std::string const& encoded_string) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif // _BASE64_HPP_
|
||||
#endif // _BASE64_HPP_
|
||||
|
||||
Reference in New Issue
Block a user