AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
B64Impl Struct Reference

Static Public Member Functions

static constexpr char Encode (uint8 v)
 
static constexpr uint8 Decode (uint8 v)
 

Static Public Attributes

static constexpr std::size_t BITS_PER_CHAR = 6
 
static constexpr char PADDING = '='
 
static constexpr uint8 DECODE_ERROR = 0xff
 

Detailed Description

Member Function Documentation

◆ Decode()

static constexpr uint8 B64Impl::Decode ( uint8  v)
inlinestaticconstexpr
39 {
40 if (('A' <= v) && (v <= 'Z')) { return (v - 'A'); }
41 if (('a' <= v) && (v <= 'z')) { return (v - 'a') + 26; }
42 if (('0' <= v) && (v <= '9')) { return (v - '0') + 52; }
43 if (v == '+') { return 62; }
44 if (v == '/') { return 63; }
45 return DECODE_ERROR;
46 }
static constexpr uint8 DECODE_ERROR
Definition: Base64.cpp:37

References DECODE_ERROR.

◆ Encode()

static constexpr char B64Impl::Encode ( uint8  v)
inlinestaticconstexpr
28 {
29 ASSERT(v < 0x40);
30 if (v < 26) { return 'A' + v; }
31 if (v < 52) { return 'a' + (v - 26); }
32 if (v < 62) { return '0' + (v - 52); }
33 if (v == 62) { return '+'; }
34 else { return '/'; }
35 }
#define ASSERT
Definition: Errors.h:68

References ASSERT.

Member Data Documentation

◆ BITS_PER_CHAR

constexpr std::size_t B64Impl::BITS_PER_CHAR = 6
staticconstexpr

◆ DECODE_ERROR

constexpr uint8 B64Impl::DECODE_ERROR = 0xff
staticconstexpr

Referenced by Decode().

◆ PADDING

constexpr char B64Impl::PADDING = '='
staticconstexpr