2 #ifndef BASE64_H_5FKG12HF
3 #define BASE64_H_5FKG12HF
15 USCXML_API
inline std::string base64Encode(
const char* data,
unsigned int len,
bool withBlockEnd =
true) {
17 base64_init_encodestate(ctx);
26 char* out = (
char*)malloc(len * 1.4 + 814);
27 written += base64_encode_block(data, len, out, ctx);
29 written += base64_encode_blockend(out + written, ctx);
32 std::string result(out, written);
38 USCXML_API
inline std::string base64Decode(
const std::string& data) {
40 base64_init_decodestate(ctx);
42 char* out = (
char*)malloc(data.size());
43 size_t size = base64_decode_block(data.data(), data.size(), out, ctx);
45 std::string result(out, size);
Definition: Breakpoint.cpp:26