why I am not geting the same result after encoding a string in base64 with JAVA and arduino library
Arduino code:
char data[] = "0123456789012345";
int inputLen = sizeof(data);
char encoded[100];
base64_encode(encoded, data, inputLen);
Serial.print("encoded base 64:");
Serial.println(encoded);
Arduino code result
encoded base 64:MDEyMzQ1Njc4OTAxMjM0NQA=
Java code:
static String message= "0123456789012345";
/////
String encoded = DatatypeConverter.printBase64Binary(message.getBytes());
System.out.println("encoded value is \t" + encoded);
Java code result:
encoded value is MDEyMzQ1Njc4OTAxMjM0NQ==
Why is the arduino library adding extra data at the end?
Thanks!