4
* Copyright 2009-2010 Krzysztof Piotr Oledzki <ole@ans.pl>
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version
9
* 2 of the License, or (at your option) any later version.
15
const char base64tab[65]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
18
#define base '#' /* arbitrary chosen base value */
20
#define B64PADV B64MAX
24
int i, min = 255, max = 0;
26
for (i = 0; i < sizeof(base64rev); i++)
29
for (i = 0; i < B64MAX; i++) {
39
for (i = 0; i < B64MAX; i++) {
43
printf("Wrong base value @%d\n", i);
47
base64rev[c - min] = base+i+1;
50
base64rev['=' - min] = base + B64PADV;
52
base64rev[max - min + 1] = '\0';
54
printf("#define B64BASE '%c'\n", base);
55
printf("#define B64CMIN '%c'\n", min);
56
printf("#define B64CMAX '%c'\n", max);
57
printf("#define B64PADV %u\n", B64PADV);
60
printf("const char base64rev[]=\"");
61
for (p = base64rev; *p; p++) {