codex
Loading...
Searching...
No Matches
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.
 
static char * decode (std::string_view src, char *dst)
 Decodes a byte stream.
 
static void encode (std::string_view src, char *dst)
 Encodes a byte stream.
 
static char * decode (std::string_view src, char *dst)
 Decodes a byte stream.
 

Static Private Attributes

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

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 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 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: