mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-29 10:17:15 +02:00
use libbase64 macro to calculate base64 length (#2007)
This commit is contained in:
committed by
Me No Dev
parent
3902aa4019
commit
259ff80d60
@ -37,8 +37,7 @@ extern "C" {
|
||||
*/
|
||||
String base64::encode(uint8_t * data, size_t length)
|
||||
{
|
||||
// base64 needs more size then the source data
|
||||
size_t size = ((length * 1.6f) + 1);
|
||||
size_t size = base64_encode_expected_len(length) + 1;
|
||||
char * buffer = (char *) malloc(size);
|
||||
if(buffer) {
|
||||
base64_encodestate _state;
|
||||
|
Reference in New Issue
Block a user