First: I'm really not a pro in using C++
I'm using this code to en-/decode to/from Base64 strings. The compiler says, that it can't find the decode method. Any ideas?
base64.h:
I'm using this code to en-/decode to/from Base64 strings. The compiler says, that it can't find the decode method. Any ideas?
B4X:
#include "base64.h"
...
...
void b64 (B4R::Object* o) {
String toEncode = "Test encoding";
String encoded = base64::encode(toEncode); 'works
Serial.println(encoded);
size_t outputLength;
unsigned char * decoded = base64::decode((unsigned char *)encoded.c_str(), strlen(encoded.c_str()), &outputLength);
Serial.print("Length of decoded message: ");
Serial.println(outputLength);
Serial.printf("%.*s", outputLength, decoded);
free(decoded);
}
B4X:
b4r_encryption.cpp:48:29: error: 'decode' is not a member of 'base64'
base64.h:
B4X:
/*
* Base64 encoding/decoding (RFC1341)
* Copyright (c) 2005, Jouni Malinen <j@w1.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Alternatively, this software may be distributed under the terms of BSD
* license.
*
* See README and COPYING for more details.
*/
#ifndef BASE64_H
#define BASE64_H
unsigned char * base64_encode(const unsigned char *src, size_t len,
size_t *out_len);
unsigned char * base64_decode(const unsigned char *src, size_t len,
size_t *out_len);
#endif /* BASE64_H */