peapod  0.1.0
EAPOL Proxy Daemon
Macros | Functions | Variables
b64enc.c File Reference

Base64 encoder. More...

#include "b64enc.h"
Include dependency graph for b64enc.c:

Macros

#define b64len(len)   (4 * ((len) / 3) + 5)
 The length of the resulting Base64-encoded string, including the null terminator, from an input of length len. More...
 

Functions

char * b64enc (const uint8_t *in, size_t len)
 Base64 encoder. More...
 

Variables

static const char b64 [64]
 Base64 index table. More...
 

Detailed Description

Base64 encoder.

Macro Definition Documentation

#define b64len (   len)    (4 * ((len) / 3) + 5)

The length of the resulting Base64-encoded string, including the null terminator, from an input of length len.

Function Documentation

char* b64enc ( const uint8_t *  in,
size_t  len 
)

Base64 encoder.

Parameters
inData to be Base64-encoded
lenThe length of in
Returns
A newly allocated C string with the Base64-encoded contents of in if successful, or NULL if unsuccessful
Note
If successful, caller is responsible for free(3)ing the result

Variable Documentation

const char b64[64]
static
Initial value:
= {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', '0', '1', '2', '3',
'4', '5', '6', '7', '8', '9', '+', '/'
}

Base64 index table.