a class to convert between different systems.
More...
#include <Text.hpp>
|
static std::string | dec2Basis (int number, int basis) |
|
static int | basis2Dec (std::string number, int basis) |
|
static UI::Util::auto_ptr< unsigned char > | xorEncrypt (std::string const &message, std::string const &key, int *length) |
|
static std::string | xorDecrypt (const unsigned char *message, const int length, std::string const &key) |
|
static std::string | base64Encode (const unsigned char *message, const int length) |
|
static UI::Util::auto_ptr< unsigned char > | base64Decode (std::string const &message, int *length) |
|
a class to convert between different systems.
- Deprecated:
- All different conversions here should rather get a XXXConverter class in Recoder.?pp (and an appropriate switch in the Recoder class if needed).
UI::Util::auto_ptr< unsigned char > UI::Util::XConversion::base64Decode |
( |
std::string const & |
message, |
|
|
int * |
length |
|
) |
| |
|
static |
returns an array of bytes which were encoded in the passed character array.
- Parameters
-
message | a base64 encoded message |
length | used to store the result (Binary) |
- Returns
- number decoded chars
References UI::Util::join(), and UI::Util::operator<<().
std::string UI::Util::XConversion::base64Encode |
( |
const unsigned char * |
message, |
|
|
const int |
length |
|
) |
| |
|
static |
returns an array of base64-encoded characters to represent the passed data array.
- Parameters
-
message | the array of bytes to encode |
length | length of the byte array |
- Returns
- result base64 encoded message (ASCII)
int UI::Util::XConversion::basis2Dec |
( |
std::string |
number, |
|
|
int |
basis |
|
) |
| |
|
static |
Convert a number represented by any basis between
2 (bin) and 16 (hex) to a dezimal number (10)
- Parameters
-
number | the numbet to convert |
basis | the basis to use |
- Returns
- a number represented in decimal (basis 10)
std::string UI::Util::XConversion::dec2Basis |
( |
int |
number, |
|
|
int |
basis |
|
) |
| |
|
static |
Convert a dezimal (10) represented number in a number
represented by any basis between 2 (Bin) and 16 (Hex)
- Parameters
-
number | the number to convert |
basis | the basis to use |
- Returns
- a number represented by the wanted basis
or an empty string
std::string UI::Util::XConversion::xorDecrypt |
( |
const unsigned char * |
message, |
|
|
const int |
length, |
|
|
std::string const & |
key |
|
) |
| |
|
static |
decrypt a message using xor and the given key
- Parameters
-
message | the message to decrypt |
length | the length of the message |
key | the key used to decrypt the message |
- Returns
- the decrypted message (ASCII)
UI::Util::auto_ptr< unsigned char > UI::Util::XConversion::xorEncrypt |
( |
std::string const & |
message, |
|
|
std::string const & |
key, |
|
|
int * |
length |
|
) |
| |
|
static |
encrypt a message using xor and the given key
- Parameters
-
message | the mesaage to encrypt |
key | the key used to encrypt the message |
length | number of encrypted chars (return) |
- Returns
- the encrypted message (binary)
The documentation for this class was generated from the following files: