eyBuildLib API Reference : eyBuildLib

ebbase64

NAME

ebbase64 - base64 MIME encoding and decoding

ROUTINES

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

DESCRIPTION

base64 MIME encoding and decoding, RFC3548


eyBuildLib : Routines

base64_encode( )

NAME

base64_encode( ) - encoding src with base64 and store into dst

SYNOPSIS

int base64_encode
    (
    char *       dst,         /* destination buffer */
    const char * src,         /* source buffer */
    int          slen         /* length to encoding */
    )

DESCRIPTION

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.

RETURNS

pointer to dst buffer

SEE ALSO

ebbase64


eyBuildLib : Routines

base64_decode( )

NAME

base64_decode( ) - decoding src with base64 and store into dst

SYNOPSIS

int base64_decode
    (
    char *       dst,         /* destination buffer */
    const char * src,         /* source buffer */
    int          slen         /* length to encoding */
    )

DESCRIPTION

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.

RETURNS

pointer to dst buffer, or NULL if error

SEE ALSO

ebbase64


eyBuildLib : Routines

ebBase64Encode( )

NAME

ebBase64Encode( ) - encoding src with base64 and store into dst

SYNOPSIS

int ebBase64Encode
    (
    char *       dst,         /* destination buffer */
    const char * src,         /* source buffer */
    int          slen         /* length to encoding */
    )

DESCRIPTION

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.

RETURNS

the length of dst string (excludes the tailed \0).

SEE ALSO

ebbase64


eyBuildLib : Routines

ebBase64Decode( )

NAME

ebBase64Decode( ) - decoding src with base64 and store into dst

SYNOPSIS

int ebBase64Decode
    (
    char *       dst,         /* destination buffer */
    const char * src,         /* source buffer */
    int          slen         /* length to decoding */
    )

DESCRIPTION

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.

NOTE

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.

RETURNS

ret <0 if error, otherwise the length of dst string (excludes the tailed \0).

SEE ALSO

ebbase64