AzeorthCore 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
27 {
28 if (('A' <= v) && (v <= 'Z')) { return (v - 'A'); }
29 if (('a' <= v) && (v <= 'z')) { return (v - 'a') + 26; }
30 if (('0' <= v) && (v <= '9')) { return (v - '0') + 52; }
31 if (v == '+') { return 62; }
32 if (v == '/') { return 63; }
33 return DECODE_ERROR;
34 }
static constexpr uint8 DECODE_ERROR
Definition: Base64.cpp:25

References DECODE_ERROR.

◆ Encode()

static constexpr char B64Impl::Encode ( uint8  v)
inlinestaticconstexpr
16 {
17 ASSERT(v < 0x40);
18 if (v < 26) { return 'A' + v; }
19 if (v < 52) { return 'a' + (v - 26); }
20 if (v < 62) { return '0' + (v - 52); }
21 if (v == 62) { return '+'; }
22 else { return '/'; }
23 }
#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