Radikant-Base64-c

Encoding & Decoding

Device Screen

Radikant-Base64-C is a simple library for Base64 and Base64url encoding and decoding. It serves as a primitive in many other libraries like Radikant-Cert-C and Radikant-JWT-C. Encode Throughput: 17485.57 MB/s Decode Throughput: 11260.63 MB/son Apple Silicon M2.

Introduction

Radikant-Base64-C is a simple base64 library that for encoding and decoding base64. With the ARM implementation is can reach good speeds. 

FileEditViewProject
main.c — Base64 Example
void simple_example()
{
const char *input = "Hello, World!";
char encoded[256];
uint8_t decoded[256];
size_t decoded_len = sizeof(decoded);
 
// Encode
base64_encode((const uint8_t *)input, strlen(input), encoded);
printf("Encoded: %s\n", encoded);
 
// Decode
base64_decode(encoded, strlen(encoded), decoded, &decoded_len);
decoded[decoded_len] = '\0'; // Null-terminate
printf("Decoded: %s\n", decoded);
}