winapi - libb64 C routines proper usage -


i having trouble c routines in libb64, here code:

    base64_encodestate state;     int outbuflen = 2 * ninbuf;     *outbuf = new char[outbuflen];      base64_init_encodestate(&state);     int r1 = base64_encode_block(inbuf, ninbuf, *outbuf, &state);     int r2 = base64_encode_blockend(*outbuf, &state);     base64_init_encodestate(&state);

this puts = @ beginning, not @ end.

so tried this:

    base64_encodestate state;     int outbuflen = 2 * ninbuf;     *outbuf = new char[outbuflen];      base64_init_encodestate(&state);     int r1 = base64_encode_block(inbuf, ninbuf, *outbuf, &state);     int r2 = base64_encode_blockend(*outbuf+ r1, &state);     base64_init_encodestate(&state);

this works, not "large" (~800kb text) files, skips end = entirely. in case base64_encode_blockend(code_out,state), enters case step_c state->result = 0. tried writing b64 data file using size reported libb64 functions, misses end or impartial. im not sure.

i'm pretty fed this. based code on struct encode , decode.

also know if there windows api base64 encode/decode? not using c++ standard stuff, thats why don't use structs.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -