1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-21 21:22:31 +03:00

[BREAKING] base64::encode() compat with esp32: no newlines by default (#7910)

This commit is contained in:
david gauchard
2021-03-15 01:24:33 +01:00
committed by GitHub
parent 656a33e6f8
commit 4cc1472821

View File

@ -33,11 +33,23 @@ public:
// 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 doNewLines);
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 encode(const String& text)
{
return encode(text, false);
}
private:
};