|
|
|
|
|
|
|
|
* nul terminated to make it easier to use as a C string. The nul terminator is |
|
|
* nul terminated to make it easier to use as a C string. The nul terminator is |
|
|
* not included in out_len. |
|
|
* not included in out_len. |
|
|
*/ |
|
|
*/ |
|
|
unsigned char* base64_encode(const unsigned char *src, size_t len, |
|
|
|
|
|
|
|
|
unsigned char* lc6base64_encode(const unsigned char *src, size_t len, |
|
|
size_t *out_len) |
|
|
size_t *out_len) |
|
|
{ |
|
|
{ |
|
|
unsigned char *out, *pos; |
|
|
unsigned char *out, *pos; |
|
|
|
|
|
|
|
|
* |
|
|
* |
|
|
* Caller is responsible for freeing the returned buffer. |
|
|
* Caller is responsible for freeing the returned buffer. |
|
|
*/ |
|
|
*/ |
|
|
unsigned char * base64_decode(const unsigned char *src, size_t len, |
|
|
|
|
|
|
|
|
unsigned char * lc6base64_decode(const unsigned char *src, size_t len, |
|
|
size_t *out_len) |
|
|
size_t *out_len) |
|
|
{ |
|
|
{ |
|
|
unsigned char dtable[256], *out, *pos, block[4], tmp; |
|
|
unsigned char dtable[256], *out, *pos, block[4], tmp; |