From 7ba036ae68c3d53debd1bc299939833e73655d0c Mon Sep 17 00:00:00 2001 From: david gauchard Date: Sat, 6 Mar 2021 23:16:46 +0100 Subject: [PATCH 1/4] [BREAKING] base64::encode() compat with esp32 --- cores/esp8266/base64.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cores/esp8266/base64.h b/cores/esp8266/base64.h index 49a6cdfb01..a1169e3ff7 100644 --- a/cores/esp8266/base64.h +++ b/cores/esp8266/base64.h @@ -33,11 +33,23 @@ class base64 // NOTE: The default behaviour of backend (lib64) // is to add a newline every 72 (encoded) characters output. // This may 'break' longer uris and json variables - static String encode(const uint8_t * data, size_t length, bool doNewLines = true); - static String inline encode(const String& text, bool doNewLines = true) + static String encode(const uint8_t * data, size_t length, bool doNewLine); + static inline String encode(const String& text, bool doNewLines) { return encode( (const uint8_t *) text.c_str(), text.length(), doNewLines ); } + + // esp32 compat: + + static inline String encode(const uint8_t * data, size_t length) + { + return encode(data, length, false); + } + + static inline String inline encode(const String& text) + { + return encode(test, false); + } private: }; From e73426cda2587cff61b4ed09777f176c83a76659 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Sat, 6 Mar 2021 23:19:58 +0100 Subject: [PATCH 2/4] typo --- cores/esp8266/base64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp8266/base64.h b/cores/esp8266/base64.h index a1169e3ff7..5b61e44301 100644 --- a/cores/esp8266/base64.h +++ b/cores/esp8266/base64.h @@ -33,7 +33,7 @@ class base64 // NOTE: The default behaviour of backend (lib64) // is to add a newline every 72 (encoded) characters output. // This may 'break' longer uris and json variables - static String encode(const uint8_t * data, size_t length, bool doNewLine); + static String encode(const uint8_t * data, size_t length, bool doNewLines); static inline String encode(const String& text, bool doNewLines) { return encode( (const uint8_t *) text.c_str(), text.length(), doNewLines ); From 96b1eb1b393c119ec98d51fa471fe244820f9754 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Sat, 6 Mar 2021 23:20:42 +0100 Subject: [PATCH 3/4] ditto --- cores/esp8266/base64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp8266/base64.h b/cores/esp8266/base64.h index 5b61e44301..abe39f6b12 100644 --- a/cores/esp8266/base64.h +++ b/cores/esp8266/base64.h @@ -46,7 +46,7 @@ class base64 return encode(data, length, false); } - static inline String inline encode(const String& text) + static inline String encode(const String& text) { return encode(test, false); } From 6d919d94c17c6b58a0a8411bd2793250778fbfcb Mon Sep 17 00:00:00 2001 From: david gauchard Date: Sat, 6 Mar 2021 23:24:51 +0100 Subject: [PATCH 4/4] typo --- cores/esp8266/base64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp8266/base64.h b/cores/esp8266/base64.h index abe39f6b12..d6857d1d23 100644 --- a/cores/esp8266/base64.h +++ b/cores/esp8266/base64.h @@ -48,7 +48,7 @@ class base64 static inline String encode(const String& text) { - return encode(test, false); + return encode(text, false); } private: };