| 218 | } |
| 219 | |
| 220 | bool Base64Decode(const char* in, int64_t in_len, int64_t out_max, char* out, |
| 221 | unsigned* out_len) { |
| 222 | if (UNLIKELY((in_len & 3) != 0)) return false; |
| 223 | const int decode_result = sasl_decode64(in, static_cast<unsigned>(in_len), out, |
| 224 | static_cast<unsigned>(out_max), out_len); |
| 225 | if (UNLIKELY(decode_result != SASL_OK || *out_len != out_max - 1)) return false; |
| 226 | return true; |
| 227 | } |
| 228 | |
| 229 | void EscapeForHtml(const string& in, stringstream* out) { |
| 230 | DCHECK(out != NULL); |
no outgoing calls