base64.c File Reference
#include "squid.h"
#include "base64.h"
Include dependency graph for base64.c:

Go to the source code of this file.

Macros

#define TABLE_INVALID   -1
 
#define TABLE_SPACE   -2
 
#define TABLE_END   -3
 
#define ENCODE(alphabet, x)   ((alphabet)[0x3F & (x)])
 

Functions

void base64_decode_init (struct base64_decode_ctx *ctx)
 
int base64_decode_single (struct base64_decode_ctx *ctx, uint8_t *dst, char src)
 
int base64_decode_update (struct base64_decode_ctx *ctx, size_t *dst_length, uint8_t *dst, size_t src_length, const char *src)
 
int base64_decode_final (struct base64_decode_ctx *ctx)
 
static void encode_raw (const char *alphabet, char *dst, size_t length, const uint8_t *src)
 
void base64_encode_raw (char *dst, size_t length, const uint8_t *src)
 
void base64_encode_group (char *dst, uint32_t group)
 
void base64_encode_init (struct base64_encode_ctx *ctx)
 
size_t base64_encode_single (struct base64_encode_ctx *ctx, char *dst, uint8_t src)
 
size_t base64_encode_update (struct base64_encode_ctx *ctx, char *dst, size_t length, const uint8_t *src)
 
size_t base64_encode_final (struct base64_encode_ctx *ctx, char *dst)
 

Variables

static const char base64_encode_table [64]
 

Macro Definition Documentation

◆ ENCODE

#define ENCODE (   alphabet,
 
)    ((alphabet)[0x3F & (x)])

Definition at line 166 of file base64.c.

◆ TABLE_END

#define TABLE_END   -3

Definition at line 51 of file base64.c.

◆ TABLE_INVALID

#define TABLE_INVALID   -1

Definition at line 49 of file base64.c.

◆ TABLE_SPACE

#define TABLE_SPACE   -2

Definition at line 50 of file base64.c.

Function Documentation

◆ base64_decode_final()

int base64_decode_final ( struct base64_decode_ctx ctx)

◆ base64_decode_init()

◆ base64_decode_single()

int base64_decode_single ( struct base64_decode_ctx ctx,
uint8_t *  dst,
char  src 
)

◆ base64_decode_update()

int base64_decode_update ( struct base64_decode_ctx ctx,
size_t dst_length,
uint8_t *  dst,
size_t  src_length,
const char *  src 
)

◆ base64_encode_final()

◆ base64_encode_group()

void base64_encode_group ( char *  dst,
uint32_t  group 
)

Definition at line 223 of file base64.c.

References base64_encode_table, and ENCODE.

◆ base64_encode_init()

◆ base64_encode_raw()

void base64_encode_raw ( char *  dst,
size_t  length,
const uint8_t *  src 
)

Definition at line 217 of file base64.c.

References base64_encode_table, and encode_raw().

◆ base64_encode_single()

size_t base64_encode_single ( struct base64_encode_ctx ctx,
char *  dst,
uint8_t  src 
)

◆ base64_encode_update()

◆ encode_raw()

static void encode_raw ( const char *  alphabet,
char *  dst,
size_t  length,
const uint8_t *  src 
)
static

Definition at line 169 of file base64.c.

References assert, BASE64_ENCODE_RAW_LENGTH, and ENCODE.

Referenced by base64_encode_raw(), and base64_encode_update().

Variable Documentation

◆ base64_encode_table

const char base64_encode_table[64]
static
Initial value:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/"

Definition at line 211 of file base64.c.

Referenced by base64_encode_group(), base64_encode_init(), and base64_encode_raw().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors