MySQL 8.0.40
Source Code Documentation
|
Generic Base64 codec. More...
#include <base64.h>
Public Types | |
using | alphabet_type = std::array< char, 64 > |
type of all alphabet. More... | |
using | inverse_alphabet_type = std::array< int8_t, 256 > |
type of all inverse mappings of alphabets. More... | |
Static Public Member Functions | |
template<Base64Endianess endianess, bool PaddingMandatory, char PaddingChar> | |
static std::vector< uint8_t > | decode (const std::string &encoded, const inverse_alphabet_type &inverse_alphabet) |
template<Base64Endianess endianess, bool PaddingMandatory, char PaddingChar> | |
static std::string | encode (const std::vector< uint8_t > &data, const alphabet_type &alphabet) |
Generic Base64 codec.
Base64 comes in many flavours:
they differ by
Base64Impl provides generic encode and decode methods which are parametrized by Endianness, Padding.
Parametrization with templates allows to provide:
using Alphabet=Crypt
octet(hex): 55 uint32: ........ ........ 01010101 (LSB) uint32: ...... ...... ....01 010101 (LSB) sextet(hex): 1 15 Alphabet: / J Out: J/
using Alphabet=Crypt
octet(hex): 55 uint32: 01010101 ........ ........ (LSB) uint32: 010101 01.... ...... ...... (LSB) sextet(hex): 15 10 Alphabet: J E Out: JE
If padding is defined mandatory,
If padding is not mandatory,
using Base64Impl::alphabet_type = std::array<char, 64> |
type of all alphabet.
using Base64Impl::inverse_alphabet_type = std::array<int8_t, 256> |
type of all inverse mappings of alphabets.
|
inlinestatic |
|
inlinestatic |