codex
base64.hpp File Reference
#include <algorithm>
#include <iterator>
#include <limits>
#include <string_view>
Include dependency graph for base64.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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

Functions

consteval char lut_idx (std::string_view lut, char c)
 Performs a reverse look-up. More...
 
consteval auto gen_rlut (std::string_view lut)
 Creates an array that contains the position of every byte in lut. More...
 

Function Documentation

◆ gen_rlut()

consteval auto gen_rlut ( std::string_view  lut)

Creates an array that contains the position of every byte in lut.

Returns
An array a such that:
  • a[c] == 0 if c is not found in a or is =
  • lut[a[c]] == c otherwise
Here is the call graph for this function:

◆ lut_idx()

consteval char lut_idx ( std::string_view  lut,
char  c 
)

Performs a reverse look-up.

Parameters
lutLook-up table.
cCharacter whose position in lut is returned.
Returns
The position of c or lut.size() if not found.
Here is the call graph for this function: