return (isalnum(c) || (c == '+') || (c == '/'));
}
+bool base64_is_valid(std::string const& s)
+{
+ for(size_t i=0; i<s.size(); i++)
+ if(!is_base64(s[i])) return false;
+ return true;
+}
+
std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) {
std::string ret;
int i = 0;
for (j = 0; (j < i + 1); j++)
ret += base64_chars[char_array_4[j]];
-
- while((i++ < 3))
- ret += '=';
+
+ // Don't pad it with =
+ /*while((i++ < 3))
+ ret += '=';*/
}