base64.c File Reference
#include "includes.h"
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <signal.h>
#include <sys/types.h>
#include <errno.h>
#include <ctype.h>
#include <time.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/uio.h>
#include <sys/time.h>
Go to the source code of this file.
Functions |
unsigned char * | base64_decode (const unsigned char *src, size_t len, size_t *out_len) |
unsigned char * | base64_encode (const unsigned char *src, size_t len, size_t *out_len) |
Variables |
static const unsigned char | base64_table [65] |
Function Documentation
unsigned char* base64_decode |
( |
const unsigned char * |
src, |
|
|
size_t |
len, |
|
|
size_t * |
out_len | |
|
) |
| | |
base64_decode - Base64 decode : Data to be decoded : Length of the data to be decoded : Pointer to output length variable Returns: Allocated buffer of out_len bytes of decoded data, or NULL on failure
Caller is responsible for freeing the returned buffer.
Definition at line 103 of file base64.c.
unsigned char* base64_encode |
( |
const unsigned char * |
src, |
|
|
size_t |
len, |
|
|
size_t * |
out_len | |
|
) |
| | |
base64_encode - Base64 encode : Data to be encoded : Length of the data to be encoded : Pointer to output length variable, or NULL if not used Returns: Allocated buffer of out_len bytes of encoded data, or NULL on failure
Caller is responsible for freeing the returned buffer. Returned buffer is nul terminated to make it easier to use as a C string. The nul terminator is not included in out_len.
Definition at line 35 of file base64.c.
Variable Documentation
Initial value:
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
Definition at line 20 of file base64.c.