jaulib v1.3.0
Jau Support Library (C++, Java, ..)
Classes | Functions
jau::codec::base Namespace Reference

Base codecs, i.e. More...

Classes

class  alphabet
 Base Alphabet Specification providing the alphabet for encode() and decode(). More...
 
class  ascii38_alphabet
 Safe base 38 alphabet with ASCII code-point sorting order. More...
 
class  ascii64_alphabet
 Safe base 64 alphabet with ASCII code-point sorting order. More...
 
class  ascii86_alphabet
 Base 86 alphabet with ASCII code-point sorting order. More...
 
class  base64_alphabet
 Safe canonical base64 alphabet, without ASCII code-point sorting order. More...
 
class  base64url_alphabet
 Safe canonical base64url alphabet, without ASCII code-point sorting order. More...
 
class  natural64_alphabet
 Safe natural base 64 alphabet, both without ASCII code-point sorting order. More...
 
class  natural86_alphabet
 Natural base 86 alphabet, without ASCII code-point sorting order. More...
 

Functions

int64_t decode (const std::string_view &str, const alphabet &aspec) noexcept
 Decodes a given symbolic string representing a given alphabet and its base to a positive decimal number. More...
 
std::vector< uint8_t > decode64 (const std::string_view &str, const alphabet &aspec) noexcept
 Decodes a given symbolic string representing using given alphabet and fixed base 64 to octets according to base64 RFC 4648. More...
 
std::vector< uint8_t > decode64_lf (const std::string_view &str, const alphabet &aspec) noexcept
 Decodes a given symbolic string representing using given alphabet and fixed base 64 to octets according to base64 RFC 4648 and removes all linefeeds before decoding as required for PEM and MIME. More...
 
std::vector< uint8_t > decode64_lf (std::string &str, const alphabet &aspec) noexcept
 Decodes a given symbolic string representing using given alphabet and fixed base 64 to octets according to base64 RFC 4648 and removes all linefeeds before decoding as required for PEM and MIME. More...
 
std::string encode (int num, const alphabet &aspec, const unsigned int min_width=0) noexcept
 Encodes a given positive decimal number to a symbolic string representing a given alphabet and its base. More...
 
std::string encode (int64_t num, const alphabet &aspec, const unsigned int min_width=0) noexcept
 Encodes a given positive decimal number to a symbolic string representing a given alphabet and its base. More...
 
std::string encode64 (const void *in_octets, size_t in_len, const alphabet &aspec) noexcept
 Encodes given octets using the given alphabet and fixed base 64 encoding according to base64 RFC 4648. More...
 
std::string encode64_mime (const void *in_octets, size_t in_len, const alphabet &aspec) noexcept
 Encodes given octets using the given alphabet and fixed base 64 encoding according to base64 RFC 4648 and adds line-feeds every 76 characters as required for MIME. More...
 
std::string encode64_pem (const void *in_octets, size_t in_len, const alphabet &aspec) noexcept
 Encodes given octets using the given alphabet and fixed base 64 encoding according to base64 RFC 4648 and adds line-feeds every 64 characters as required for PEM. More...
 
size_t insert_lf (std::string &str, const size_t period) noexcept
 Inserts a line feed (LF) character \n (ASCII 0x0a) after every period of characters. More...
 
bool operator!= (const alphabet &lhs, const alphabet &rhs) noexcept
 
bool operator== (const alphabet &lhs, const alphabet &rhs) noexcept
 
size_t remove_lf (std::string &str) noexcept
 Removes line feed character from str. More...
 
std::string to_string (const alphabet &v) noexcept
 

Detailed Description

Base codecs, i.e.

changing the decimal or binary values' base for a different representation.