From 9754372d5e4125bf5850d9cd3ae93d529efdef8d Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 21 Dec 2013 18:32:27 -0800 Subject: Preliminary WebSocket protocol support. --- includes/Base64.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 includes/Base64.h (limited to 'includes/Base64.h') 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 + +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); +}; + +}; -- cgit v1.2.3