ELinks 0.16.1.1
base64.c File Reference

Base64 encode/decode implementation. More...

#include <string.h>
#include "elinks.h"
#include "util/base64.h"
#include "util/error.h"
#include "util/memory.h"
Include dependency graph for base64.c:

Functions

char * base64_encode (char *in)
char * base64_encode_bin (char *in, int inlen, int *outlen)
char * base64_decode (const char *in)
char * base64_decode_bin (const char *in, int inlen, int *outlen)
 Decode a Base64 string.

Variables

static unsigned char base64_chars [] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

Detailed Description

Base64 encode/decode implementation.

Function Documentation

◆ base64_decode()

char * base64_decode ( const char * in)

◆ base64_decode_bin()

char * base64_decode_bin ( const char * in,
int inlen,
int * outlen )

Decode a Base64 string.

Parameters
inInput Base64 string
inlenLength of in, in bytes
[out]outlenLength of decoded string
Returns
the string decoded (must be freed by the caller) or NULL if an error occurred (syntax error or out of memory)

◆ base64_encode()

char * base64_encode ( char * in)

◆ base64_encode_bin()

char * base64_encode_bin ( char * in,
int inlen,
int * outlen )

Variable Documentation

◆ base64_chars

unsigned char base64_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
static