base64.h File Reference
#include "WString.h"
Include dependency graph for base64.h:

Go to the source code of this file.

Functions

int base64_encode (size_t in_len, const unsigned char *in, size_t out_len, char *out)
 encode binary data into base64 digits with MIME style === pads More...
 
String base64_encode (const unsigned char *in, size_t in_len)
 encode a block of data into base64, stored in a String More...
 
static String base64_encode (const String &in)
 encode a block of data into base64, both input and output are String objects More...
 
int base64_decode (size_t in_len, const char *in, size_t out_len, unsigned char *out)
 decode base64 digits with MIME style === pads into binary data More...
 
String base64_decode (const char *in, size_t in_len)
 decode base64 text into binary data More...
 
static String base64_decode (const String &in)
 encode a block of data into base64, both input and output are String objects More...
 

Function Documentation

◆ base64_decode() [1/3]

int base64_decode ( size_t  in_len,
const char *  in,
size_t  out_len,
unsigned char *  out 
)

decode base64 digits with MIME style === pads into binary data

Parameters
in_lenlength of source base64 text in characters
inbase64-encoded text
out_lensize of output buffer
outbuffer for decoded output
Return values
intlength of decoded output, or -1 if output buffer is too small

◆ base64_decode() [2/3]

String base64_decode ( const char *  in,
size_t  in_len 
)

decode base64 text into binary data

Parameters
insource base64-encoded text
in_lenlength of input text in characters
Return values
Stringthe decoded text

◆ base64_decode() [3/3]

static String base64_decode ( const String in)
inlinestatic

encode a block of data into base64, both input and output are String objects

Parameters
in
Return values
String

◆ base64_encode() [1/3]

int base64_encode ( size_t  in_len,
const unsigned char *  in,
size_t  out_len,
char *  out 
)

encode binary data into base64 digits with MIME style === pads

Parameters
in_lenquantity of characters to encode
indata to encode
out_lensize of output buffer
outbuffer for base64-encoded text
Return values
intlength of encoded text, or -1 if output buffer is too small
Note
Output is broken by newline every 72 characters. Final terminating newline is not included.

◆ base64_encode() [2/3]

String base64_encode ( const unsigned char *  in,
size_t  in_len 
)

encode a block of data into base64, stored in a String

Parameters
intext to encode
in_lenquantity of characters to encode
Return values
Stringthe base64-encoded text

◆ base64_encode() [3/3]

static String base64_encode ( const String in)
inlinestatic

encode a block of data into base64, both input and output are String objects

Parameters
in
Return values
String