rsstats 0.0.1
Redis Enterprise Statistic collector
base64.c File Reference

Simple Base64 encoding and decoding functions. More...

#include "base64.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Include dependency graph for base64.c:

Go to the source code of this file.

Functions

char * base64_encode (char *plain)
 Encode a zero terminated C string in Base64. More...
 
char * base64_decode (char *cipher)
 Decode a zero terminated C Base64 encoded string. More...
 

Detailed Description

Simple Base64 encoding and decoding functions.

Copied and adapted from https://github.com/elzoughby/Base64

Author
François Cerbelle (Fanfan), franc.nosp@m.ois@.nosp@m.cerbe.nosp@m.lle..nosp@m.net

Definition in file base64.c.

Function Documentation

◆ base64_decode()

char * base64_decode ( char *  cipher)

Decode a zero terminated C Base64 encoded string.

Parameters
cipherZero Terminated C Base64 encoded string
Returns
Decoded zero terminated C string
Return values
Pointerto a zero terminated C string
NULLin case of out of memory

cipher can not be NULL. the returned value is mallocated and needs to be freed.

Definition at line 77 of file base64.c.

◆ base64_encode()

char * base64_encode ( char *  plain)

Encode a zero terminated C string in Base64.

Parameters
plainZero Terminated C string
Returns
Encoded zero terminated C string
Return values
Pointerto a zero terminated C string
NULLin case of out of memory

plain can not be NULL. the returned value is mallocated and needs to be freed.

Definition at line 39 of file base64.c.

Here is the caller graph for this function: