struct b64_encode_state
{
int phase;
size_t out_len;
char buffer[3];
};
void b64_stream_encode_init(struct b64_encode_state *state);
Call this function for init state and befor calling b64_stream_decode()
int b64_stream_encode(
struct b64_encode_state *state,
const char* str,
size_t src_len,
char* out
);
int b64_stream_encode_final(struct b64_encode_state *state, char* out);
struct b64_decode_state
{
int phase;
size_t out_len;
char buffer[4];
};
void b64_stream_decode_init(struct b64_decode_state *state);
int b64_stream_decode(
struct b64_decode_state *state,
const char* src,
size_t src_len,
char* out
);
int b64_stream_decode_final(struct b64_decode_state *state);