Skip to content

Instantly share code, notes, and snippets.

@vixtory09678
Last active March 31, 2021 08:45
Show Gist options
  • Save vixtory09678/f9261eb55cbf9002837ac886666e85fb to your computer and use it in GitHub Desktop.
Save vixtory09678/f9261eb55cbf9002837ac886666e85fb to your computer and use it in GitHub Desktop.
#include <Arduino.h>
extern "C" {
#include "crypto/base64.h"
}
void setup() {
Serial.begin(9600);
const char* message = "Hello World";
size_t outputLen;
unsigned char *encode = base64_encode((const unsigned char*)message, strlen(message), &outputLen);
unsigned char *decode = base64_decode(encode, outputLen, &outputLen);
Serial.print("plaintext : "); Serial.println(message);
Serial.print("encode : "); Serial.println((char*)encode);
Serial.print("decode : "); Serial.println((char*)decode);
}
void loop() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment