aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/lib.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/lib.c b/lib/lib.c
index 33be44b6..490235f4 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -571,6 +571,21 @@ void crc_init(unsigned int *crc_table, int little_endian)
}
}
+// Init base64 table
+
+void base64_init(char *p)
+{
+ int i;
+
+ for (i = 'A'; i != ':'; i++) {
+ if (i == 'Z'+1) i = 'a';
+ if (i == 'z'+1) i = '0';
+ *(p++) = i;
+ }
+ *(p++) = '+';
+ *(p++) = '/';
+}
+
// Quick and dirty query size of terminal, doesn't do ANSI probe fallback.
// set x=80 y=25 before calling to provide defaults. Returns 0 if couldn't
// determine size.