AzerothCore 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
36 {
37 if (v == '0') { return Decode('O'); }
38 if (v == '1') { return Decode('l'); }
39 if (v == '8') { return Decode('B'); }
40 if (('A' <= v) && (v <= 'Z')) { return (v - 'A'); }
41 if (('a' <= v) && (v <= 'z')) { return (v - 'a'); }
42 if (('2' <= v) && (v <= '7')) { return (v - '2') + 26; }
43 return DECODE_ERROR;
44 }
static constexpr uint8 Decode(uint8 v)
Definition Base32.cpp:35
static constexpr uint8 DECODE_ERROR
Definition Base32.cpp:34

References Decode(), and DECODE_ERROR.

Referenced by Decode().

◆ Encode()

static constexpr char B32Impl::Encode ( uint8  v)
inlinestaticconstexpr
28 {
29 ASSERT(v < 0x20);
30 if (v < 26) { return 'A' + v; }
31 else { return '2' + (v - 26); }
32 }
#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

The documentation for this struct was generated from the following file: