summaryrefslogtreecommitdiff
path: root/includes/Base64.h
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-12-21 18:32:27 -0800
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-12-21 18:32:27 -0800
commit9754372d5e4125bf5850d9cd3ae93d529efdef8d (patch)
treefc20e375256b95bbd13fecde0d85181100a198e4 /includes/Base64.h
parent9697add8b75b96662c8d39477e58d5841c4b9cba (diff)
Preliminary WebSocket protocol support.
Diffstat (limited to 'includes/Base64.h')
-rw-r--r--includes/Base64.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/includes/Base64.h b/includes/Base64.h
new file mode 100644
index 0000000..d039c73
--- /dev/null
+++ b/includes/Base64.h
@@ -0,0 +1,19 @@
+#pragma once
+
+#include <Exceptions.h>
+
+namespace Balau {
+
+class Base64 {
+public:
+ static String encode(const uint8_t * data, int len);
+ static int decode(const String & str_in, uint8_t * data_out);
+ static const double ratio;
+
+private:
+ static void encode_block(unsigned char in_tab[3], int len, char out[4]);
+ static int stri(char);
+ static int decode_block(char s1, char s2, char s3, char s4, unsigned char * out_tab);
+};
+
+};