libalpm
Arch Linux Package Manager Library
Functions
base64.c File Reference
#include <stdint.h>
#include "base64.h"
Include dependency graph for base64.c:

Go to the source code of this file.

Functions

int base64_decode (unsigned char *dst, size_t *dlen, const unsigned char *src, size_t slen)
 Decode a base64-formatted buffer.

Function Documentation

int base64_decode ( unsigned char *  dst,
size_t *  dlen,
const unsigned char *  src,
size_t  slen 
)

Decode a base64-formatted buffer.

Parameters:
dstdestination buffer
dlensize of the buffer
srcsource buffer
slenamount of data to be decoded
Returns:
0 if successful, POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL, or POLARSSL_ERR_BASE64_INVALID_DATA if the input data is not correct. *dlen is always updated to reflect the amount of data that has (or would have) been written.
Note:
Call this function with *dlen = 0 to obtain the required buffer size in *dlen

Definition at line 135 of file base64.c.

References POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL, and POLARSSL_ERR_BASE64_INVALID_CHARACTER.