From d9d3804e5f5aceccbaf8891741ae20ece973cce5 Mon Sep 17 00:00:00 2001 From: Peter Thorson Date: Fri, 3 May 2013 07:56:09 -0500 Subject: [PATCH] adds convenience method to base64 encode strings --- websocketpp/base64/base64.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/websocketpp/base64/base64.hpp b/websocketpp/base64/base64.hpp index ec4b3ad88f..2fed34228d 100644 --- a/websocketpp/base64/base64.hpp +++ b/websocketpp/base64/base64.hpp @@ -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_ \ No newline at end of file +#endif // _BASE64_HPP_