Functions to handle Base64 encoding and decoding. More...
#include <jabberdlib.h>Functions | |
| int | base64_encode (unsigned char *source, size_t sourcelen, char *target, size_t targetlen) |
| void | str_b64decode (char *str) |
| size_t | base64_decode (const char *source, unsigned char *target, size_t targetlen) |
Variables | |
| const char * | BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" |
Functions to handle Base64 encoding and decoding.
The function to decode base64 data is base64_decode(), the general encoding function is base64_encode(). If the data that should get encoded is not binary data, but zero terminated character data, the str_b64decode() function can be used instead, which does not require the caller to specify the length of that data that should get encoded.
| size_t base64_decode | ( | const char * | source, | |
| unsigned char * | target, | |||
| size_t | targetlen | |||
| ) |
decode base64 encoded data
| source | the encoded data (zero terminated) | |
| target | pointer to the target buffer | |
| targetlen | length of the target buffer |
Referenced by dialback_in_read_db(), and str_b64decode().
| int base64_encode | ( | unsigned char * | source, | |
| size_t | sourcelen, | |||
| char * | target, | |||
| size_t | targetlen | |||
| ) |
encode an array of bytes using Base64 (RFC 3548)
| source | the source buffer | |
| sourcelen | the length of the source buffer | |
| target | the target buffer | |
| targetlen | the length of the target buffer |
Referenced by dialback_out_read().
| void str_b64decode | ( | char * | str | ) |
decode a base64 string and put the result in the same buffer as the source
This function does not handle decoded data that contains the null byte very well as the size of the decoded data is not returned.
The result will be zero terminated.
| str | buffer for the source and the result |
References base64_decode().
| const char* BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" |
characters used for Base64 encoding
1.6.1