Skip to content

Commit 4cc1472

Browse files
authored
[BREAKING] base64::encode() compat with esp32: no newlines by default (#7910)
1 parent 656a33e commit 4cc1472

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

cores/esp8266/base64.h

+14-2
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,23 @@ class base64
3333
// NOTE: The default behaviour of backend (lib64)
3434
// is to add a newline every 72 (encoded) characters output.
3535
// This may 'break' longer uris and json variables
36-
static String encode(const uint8_t * data, size_t length, bool doNewLines = true);
37-
static String inline encode(const String& text, bool doNewLines = true)
36+
static String encode(const uint8_t * data, size_t length, bool doNewLines);
37+
static inline String encode(const String& text, bool doNewLines)
3838
{
3939
return encode( (const uint8_t *) text.c_str(), text.length(), doNewLines );
4040
}
41+
42+
// esp32 compat:
43+
44+
static inline String encode(const uint8_t * data, size_t length)
45+
{
46+
return encode(data, length, false);
47+
}
48+
49+
static inline String encode(const String& text)
50+
{
51+
return encode(text, false);
52+
}
4153
private:
4254
};
4355

0 commit comments

Comments
 (0)