eyBuildLib API Reference : eyBuildLib
ebbase64 - base64 MIME encoding and decoding
base64_encode( ) - encoding src with base64 and store into dst
base64_decode( ) - decoding src with base64 and store into dst
ebBase64Encode( ) - encoding src with base64 and store into dst
ebBase64Decode( ) - decoding src with base64 and store into dst
base64 MIME encoding and decoding, RFC3548
base64_encode( ) - encoding src with base64 and store into dst
int base64_encode ( char * dst, /* destination buffer */ const char * src, /* source buffer */ int slen /* length to encoding */ )
this routine encoding src with base64 and store into dst. Paramter slen is to limit the max length of src to encoding. This routine will add \0 automatically for dst, but it won't check the buffer size of dst. So you should keep the dst buffer size great than or equal (slen*4/3 + 4) bytes.
pointer to dst buffer
base64_decode( ) - decoding src with base64 and store into dst
int base64_decode ( char * dst, /* destination buffer */ const char * src, /* source buffer */ int slen /* length to encoding */ )
this routine decoding src with base64 and store into dst. Paramter slen is to limit the max length of src to decoding. This routine will add \0 automatically for dst, you should keep the dst buffer size great than or equal (slen*3/4 + 4) bytes.
pointer to dst buffer, or NULL if error
ebBase64Encode( ) - encoding src with base64 and store into dst
int ebBase64Encode ( char * dst, /* destination buffer */ const char * src, /* source buffer */ int slen /* length to encoding */ )
this routine encoding src with base64 and store into dst. Paramter slen is to limit the max length of src to encoding. This routine will add \0 automatically for dst, but it won't check the buffer size of dst. So you should keep the dst buffer size great than or equal (slen*4/3 + 4) bytes.
the length of dst string (excludes the tailed \0).
ebBase64Decode( ) - decoding src with base64 and store into dst
int ebBase64Decode ( char * dst, /* destination buffer */ const char * src, /* source buffer */ int slen /* length to decoding */ )
this routine decoding src with base64 and store into dst. Paramter slen is to limit the max length of src to decoding. This routine will add \0 automatically for dst, you should keep the dst buffer size great than or equal (slen*3/4 + 4) bytes.
the returned value < 0 if src is not base64 encode, you can get the sequence number(suffix+1) of invalid character by abs(ret) in src buffer.
ret <0 if error, otherwise the length of dst string (excludes the tailed \0).