codex
Base64 Class Reference

Encodes and decodes byte streams using base64. More...

#include <base64.hpp>

Static Public Member Functions

static void encode (std::string_view src, char *dst)
 Encodes a byte stream. More...
 
static char * decode (std::string_view src, char *dst)
 Decodes a byte stream. More...
 
static void encode (std::string_view src, char *dst)
 Encodes a byte stream. More...
 
static char * decode (std::string_view src, char *dst)
 Decodes a byte stream. More...
 

Static Private Attributes

static constexpr auto lut
 Look-up table for encoding, maps input 6-bit values to output characters. More...
 
static constexpr auto rlut = gen_rlut(lut)
 Reverse look-up table for encoding, maps every possible character value to a byte or zero. More...
 

Detailed Description

Encodes and decodes byte streams using base64.

Member Function Documentation

◆ decode() [1/2]

char * Base64::decode ( std::string_view  src,
char *  dst 
)
static

Decodes a byte stream.

Parameters
srcThe underlying string must be a multiple of 4 in length.
dstMust be at least output_size<3, 4>(src.size()) in length.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode() [2/2]

static char * Base64::decode ( std::string_view  src,
char *  dst 
)
static

Decodes a byte stream.

Parameters
srcThe underlying string must be a multiple of 4 in length.
dstMust be at least output_size<3, 4>(src.size()) in length.

◆ encode() [1/2]

void Base64::encode ( std::string_view  src,
char *  dst 
)
static

Encodes a byte stream.

Parameters
srcThe underlying string must be a multiple of 3 in length, extra bytes beyond src.size() must be zero.
dstMust be at least output_size<4, 3>(src.size()) in length.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ encode() [2/2]

static void Base64::encode ( std::string_view  src,
char *  dst 
)
static

Encodes a byte stream.

Parameters
srcThe underlying string must be a multiple of 3 in length, extra bytes beyond src.size() must be zero.
dstMust be at least output_size<4, 3>(src.size()) in length.

Member Data Documentation

◆ lut

static constexpr auto Base64::lut
staticconstexprprivate
Initial value:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"sv

Look-up table for encoding, maps input 6-bit values to output characters.

◆ rlut

static constexpr auto Base64::rlut = gen_rlut(lut)
staticconstexprprivate

Reverse look-up table for encoding, maps every possible character value to a byte or zero.


The documentation for this class was generated from the following files: