Kea 2.5.9
isc::util::encode::Base32HexEncoder Class Reference

Class for encoding and decoding binary data using Base32Hex as described in RFC 4648. More...

#include <encode.h>

+ Inheritance diagram for isc::util::encode::Base32HexEncoder:

Public Member Functions

 Base32HexEncoder ()
 Constructor.
 
 ~Base32HexEncoder ()=default
 Destructor.
 
- Public Member Functions inherited from isc::util::encode::BaseNEncoder
 BaseNEncoder (const std::string &algorithm, const char *digit_set, const std::vector< uint8_t > &bits_table, size_t bits_per_digit, size_t digits_per_group, const char pad_char, size_t max_pad, bool case_sensitive)
 Constructor.
 
virtual ~BaseNEncoder ()=default
 Destructor.
 
char bitsToDigit (uint8_t bits)
 Translate a byte of binary data into the appropriate algorithm digit.
 
void decode (const std::string &encoded_str, std::vector< uint8_t > &output)
 Decodes an encoded string using the encoder's algorithm.
 
uint8_t digitToBits (uint8_t digit)
 Translate a digit into the appropriate algorithm bit value.
 
std::string encode (const std::vector< uint8_t > &input)
 Encodes binary data using the encoder's algorithm.
 
std::string getAlgorithm () const
 Get the algorithm name.
 
size_t getBitsPerDigit ()
 Get the number of data bits represented by a digit.
 
const std::vector< uint8_t > & getBitsTable () const
 Get the digit lookup table.
 
const char * getDigitSet () const
 Get the digit set.
 
size_t getDigitsPerGroup () const
 Get the number of digits contained in a group.
 
size_t getMaxBitsToDigit ()
 Get the maxium index value of the digit set.
 
size_t getMaxDigitToBits ()
 Get the maxium index value of the algorithm bit table.
 
size_t getMaxPad ()
 Get the maximum number of pad characters in a group.
 
uint8_t getPadChar () const
 Get the character used for padding out to group size (0 means no padding)
 
bool isCaseSensitive ()
 Indicates whether or not the algorithm's digit set is case-sensitive.
 

Static Public Attributes

static const std::vector< uint8_t > BITS_TABLE
 Table that maps Base32Hex digits to their binary data value.
 
static const char * DIGIT_SET = "0123456789ABCDEFGHIJKLMNOPQRSTUV"
 Set of digits used for encoding in Base32Hex.
 

Additional Inherited Members

- Protected Attributes inherited from isc::util::encode::BaseNEncoder
std::string algorithm_
 Name of the algorithm, used for logging.
 
size_t bits_per_digit_
 Number of data bits represented by a digit.
 
std::vector< uint8_t > bits_table_
 Table to translate digits to data used during decoding.
 
bool case_sensitive_
 Indicates whether or not the algorithm's digit set is case-sensitive.
 
const char * digit_set_
 Set of digits (i.e. alphabet) used for encoding.
 
size_t digits_per_group_
 Number of digits contained in a group.
 
size_t max_bits_to_digit_
 Maxium index value of the digit set.
 
size_t max_digit_to_bits_
 Maxium index value of the algorithm bit table.
 
size_t max_pad_
 Maximum number of pad characters in a group.
 
const char pad_char_
 Character used for padding out to group size (0 means no padding)
 

Detailed Description

Class for encoding and decoding binary data using Base32Hex as described in RFC 4648.

Definition at line 210 of file encode.h.

Constructor & Destructor Documentation

◆ Base32HexEncoder()

isc::util::encode::Base32HexEncoder::Base32HexEncoder ( )
inline

Constructor.

Definition at line 219 of file encode.h.

◆ ~Base32HexEncoder()

isc::util::encode::Base32HexEncoder::~Base32HexEncoder ( )
default

Destructor.

Member Data Documentation

◆ BITS_TABLE

const std::vector< uint8_t > isc::util::encode::Base32HexEncoder::BITS_TABLE
static
Initial value:
= {
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xee,0xee,0xee,0xee,0xee,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xee,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
25,26,27,28,29,30,31,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
25,26,27,28,29,30,31,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
}

Table that maps Base32Hex digits to their binary data value.

Definition at line 216 of file encode.h.

◆ DIGIT_SET

const char * isc::util::encode::Base32HexEncoder::DIGIT_SET = "0123456789ABCDEFGHIJKLMNOPQRSTUV"
static

Set of digits used for encoding in Base32Hex.

Definition at line 213 of file encode.h.


The documentation for this class was generated from the following files: