AzeorthCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
B32Impl 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 = 5
 
static constexpr char PADDING = '='
 
static constexpr uint8 DECODE_ERROR = 0xff
 

Detailed Description

Member Function Documentation

◆ Decode()

static constexpr uint8 B32Impl::Decode ( uint8  v)
inlinestaticconstexpr
24 {
25 if (v == '0') { return Decode('O'); }
26 if (v == '1') { return Decode('l'); }
27 if (v == '8') { return Decode('B'); }
28 if (('A' <= v) && (v <= 'Z')) { return (v - 'A'); }
29 if (('a' <= v) && (v <= 'z')) { return (v - 'a'); }
30 if (('2' <= v) && (v <= '7')) { return (v - '2') + 26; }
31 return DECODE_ERROR;
32 }
static constexpr uint8 Decode(uint8 v)
Definition: Base32.cpp:23
static constexpr uint8 DECODE_ERROR
Definition: Base32.cpp:22

References Decode(), and DECODE_ERROR.

Referenced by Decode().

◆ Encode()

static constexpr char B32Impl::Encode ( uint8  v)
inlinestaticconstexpr
16 {
17 ASSERT(v < 0x20);
18 if (v < 26) { return 'A' + v; }
19 else { return '2' + (v - 26); }
20 }
#define ASSERT
Definition: Errors.h:68

References ASSERT.

Member Data Documentation

◆ BITS_PER_CHAR

constexpr std::size_t B32Impl::BITS_PER_CHAR = 5
staticconstexpr

◆ DECODE_ERROR

constexpr uint8 B32Impl::DECODE_ERROR = 0xff
staticconstexpr

Referenced by Decode().

◆ PADDING

constexpr char B32Impl::PADDING = '='
staticconstexpr