Anope IRC Services  Version 1.8
Functions | Variables
base64.c File Reference
#include "services.h"
Include dependency graph for base64.c:

Go to the source code of this file.

Functions

static char * int_to_base64 (long)
 
static long base64_to_int (char *)
 
char * base64enc (long i)
 
long base64dec (char *b64)
 
int b64_encode (char *src, size_t srclength, char *target, size_t targsize)
 
int b64_decode (char *src, char *target, size_t targsize)
 
char * encode_ip (unsigned char *ip)
 
int decode_ip (char *buf)
 
long base64dects (char *ts)
 

Variables

static const char Base64 []
 
static const char Pad64 = '='
 
char int6_to_base64_map []
 
char base64_to_int6_map []
 

Function Documentation

int b64_decode ( char *  src,
char *  target,
size_t  targsize 
)

Definition at line 165 of file base64.c.

References Base64, and Pad64.

Referenced by decode_ip().

int b64_encode ( char *  src,
size_t  srclength,
char *  target,
size_t  targsize 
)

Definition at line 106 of file base64.c.

References Base64, and Pad64.

Referenced by encode_ip().

static long base64_to_int ( char *  b64)
static

Definition at line 379 of file base64.c.

References base64_to_int6_map.

Referenced by base64dec().

long base64dec ( char *  b64)

Definition at line 30 of file base64.c.

References base64_to_int().

Referenced by base64dects().

long base64dects ( char *  ts)

Definition at line 394 of file base64.c.

References Anope_Free, base64dec(), and myStrGetToken().

Referenced by do_sjoin(), and do_topic().

char* base64enc ( long  i)

Definition at line 23 of file base64.c.

References int_to_base64().

Referenced by unreal_cmd_join().

int decode_ip ( char *  buf)

Definition at line 304 of file base64.c.

References b64_decode().

Referenced by anope_event_nick().

char* encode_ip ( unsigned char *  ip)

Definition at line 283 of file base64.c.

References b64_encode(), and str_signed().

static char * int_to_base64 ( long  val)
static

Definition at line 352 of file base64.c.

References int6_to_base64_map.

Referenced by base64enc().

Variable Documentation

const char Base64[]
static
Initial value:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

Definition at line 39 of file base64.c.

Referenced by b64_decode(), and b64_encode().

char base64_to_int6_map[]
Initial value:
= {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1,
-1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1,
-1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 63, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
}

Definition at line 333 of file base64.c.

Referenced by base64_to_int().

char int6_to_base64_map[]
Initial value:
= {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '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',
'{', '}'
}

Definition at line 322 of file base64.c.

Referenced by int_to_base64().

const char Pad64 = '='
static

Definition at line 41 of file base64.c.

Referenced by b64_decode(), and b64_encode().