• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include "tables.h"
2 
3 const uint8_t
4 base64_table_enc_6bit[] =
5 	"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
6 	"abcdefghijklmnopqrstuvwxyz"
7 	"0123456789"
8 	"+/";
9 
10 // In the lookup table below, note that the value for '=' (character 61) is
11 // 254, not 255. This character is used for in-band signaling of the end of
12 // the datastream, and we will use that later. The characters A-Z, a-z, 0-9
13 // and + / are mapped to their "decoded" values. The other bytes all map to
14 // the value 255, which flags them as "invalid input".
15 
16 const uint8_t
17 base64_table_dec_8bit[] =
18 {
19 	255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,		//   0..15
20 	255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,		//  16..31
21 	255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,  62, 255, 255, 255,  63,		//  32..47
22 	 52,  53,  54,  55,  56,  57,  58,  59,  60,  61, 255, 255, 255, 254, 255, 255,		//  48..63
23 	255,   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,		//  64..79
24 	 15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25, 255, 255, 255, 255, 255,		//  80..95
25 	255,  26,  27,  28,  29,  30,  31,  32,  33,  34,  35,  36,  37,  38,  39,  40,		//  96..111
26 	 41,  42,  43,  44,  45,  46,  47,  48,  49,  50,  51, 255, 255, 255, 255, 255,		// 112..127
27 	255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,		// 128..143
28 	255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
29 	255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
30 	255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
31 	255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
32 	255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
33 	255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
34 	255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
35 };
36 
37 #if BASE64_WORDSIZE >= 32
38 #  include "table_dec_32bit.h"
39 #  include "table_enc_12bit.h"
40 #endif
41