Base Framework
Classes | Static Public Member Functions | Static Public Attributes | List of all members
Base64 Class Reference

Base64 encoding support. More...

#include <base/security/Base64.h>

Inherits Object.

Classes

class  Descriptor
 Base64 encode descriptor. More...
 

Static Public Member Functions

static char valueToDigit (unsigned int value) noexcept
 
static int valueToDigit (char digit) noexcept
 
static String encode (const uint8 *buffer, MemorySize size) noexcept
 
static String encode (const String &bytes) noexcept
 

Static Public Attributes

static constexpr unsigned int BITS_PER_CHARACTER = 6
 
static const signed char VALUES [256]
 
static const char DIGITS [64]
 
static const char PAD = '='
 

Detailed Description

Base64 encoding support.

Base64 encoding (see RFC 2045 section 6.8).

Version
1.1

Member Function Documentation

◆ encode() [1/2]

static String Base64::encode ( const String bytes)
inlinestaticnoexcept

Returns the Base64 encoded data.

Parameters
bytesBuffer holding the data.

◆ encode() [2/2]

static String Base64::encode ( const uint8 *  buffer,
MemorySize  size 
)
staticnoexcept

Returns the Base64 encoded data.

Parameters
bufferBuffer holding the data.
sizeThe number of octets in the buffer.

◆ valueToDigit() [1/2]

static int Base64::valueToDigit ( char  digit)
inlinestaticnoexcept

Returns the value [0;63] of the specified digit.

Returns
-1 if not a valid Base64 digit.

◆ valueToDigit() [2/2]

static char Base64::valueToDigit ( unsigned int  value)
inlinestaticnoexcept

Returns the digit for the specified value. The value returned is undefined if the value is not in the range [0;63].

Member Data Documentation

◆ DIGITS

const char Base64::DIGITS[64]
static

Digits of the Base64 encoding.

◆ PAD

const char Base64::PAD = '='
static

The special character used to denote unused digits.

◆ VALUES

const signed char Base64::VALUES[256]
static

Lookup table for mapping digits into values.