This class offers various streaming helper functions.
static bool TSLStreamingFunctions::base64Encode |
( |
const unsigned char * | binary, |
|
|
unsigned int | binaryLength, |
|
|
char *& | outputData, |
|
|
char | index62Character = '+', |
|
|
char | index63Character = '/', |
|
|
int | lineLength = -1 ) |
|
static |
Encodes binary data into base64, padded to 4-byte boundaries using the '=' character.
The index62Character and index63Character parameters are used to specify the character to encode the base64 indices 62 and 63. Different base64 variants use different characters for these indices.
Certain base64 variants also require line breaks every nth character. The lineLength parameter is used to specify the length of each base64 line in characters. The value -1 specifies not to add line breaks.
- Parameters
-
binary | The buffer containing the binary data to be encoded. |
binaryLength | The length of the buffer passed in the binary parameter. |
outputData | This will be populated with the base64 encoded string. It should be freed using the freeBuffer method. |
index62Character | The character to encode the 62nd base64 index |
index63Character | The character to encode the 63rd base64 index |
lineLength | The length of each base64 line or -1 to specify that line breaks are not required. |
- Returns
- true on success, false otherwise.