This documentation describes the Prokee module interface.
Static Methods:
encode
These methods can be used, if the input for the encoder is a null-terminated string.
The following methods returns a new allocated memory block, in which the output is written.
The following methods write the encoded data into an existing memory block.
encode (version 2)
int base64::encode(void *data,unsigned int length,char *bstr,bool padding)
encode (version 3)
int base64::encode(void *data,unsigned int length,char *bstr,bool padding,const char *sym,char pad)
These versions, perform a length check on the output memory block.
encode (version _s2)
int base64::encode(void *data,unsigned int length,char *bstr,unsigned int bln,bool padding)
encode (version _s3)
int base64::encode(void *data,unsigned int length,char *bstr,unsigned int bln,bool padding,const char *sym,char pad)
These versions reallocate the memory of the output memory block if necessary
encode (version _realloc3)
int base64::encode(void *data,unsigned int length,char **bstr,unsigned int *bln,bool padding,const char *sym,char pad)
encode_url
These versions use different encoding symbols to encode data in urls.
encode_url (version 3)
int base64::encode_url(void *data,unsigned int length,char *bstr,unsigned int bln,bool padding)
encode_url (version 4)
int base64::encode_url(void *data,unsigned int length,char **bstr,unsigned int *bln,bool padding)
encode_length
Calculates the lenght of the encoded base64 string.
decode_length
Calculates the length of the decoded data.
decode
writing to existing memory block
decode (version 2)
int base64::decode(const char *bstr,void *data,const char *sym,char pad)
allocating a new memory block
writing to existing memory block with length check
decode (version _s2)
int base64::decode(const char *bstr,void *data,unsigned int dataln,const char *sym,char pad)
reallocating version
decode_url
These versions are for url decoding
main
main
int base64::main(int argc,char **argv)
Static Methods
encode (version _str1)
Returns the base64 encoded representation of the input string
in_str.
Signature:
char *base64::encode(const char *in_str)
Parameters:
| const char * | in_str | [IN] | a null-terminated string used as input for the encoder. |
Return value:The base64 encoded representation of the input string
in_str.
Remarks:
Die Funktion erzeugt einen base64 String mit allfälligem Padding. Als Padding Zeichen wird '=' verwenet.

Als Alphabet für die Codierung wird 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' verwendet.

The application has to free the returned memory block.
Tests:
test1: Encode/Decode-Test.
Test function:
base64_encode_str1()
encode (version _str2)
Returns the base64 encoded representation of the input string
in_str.
Signature:
char *base64::encode(const char *in_str,bool padding)
Parameters:
| const char * | in_str | [IN] | a null-terminated string used as input for the encoder. |
| bool | padding | | wheter if padding schould be used or not. |
Return value:The base64 encoded representation of the input string
in_str.
Remarks:
Falls
padding auf
true gesetzt wurde, erzeugt die Funktion einen base64 String mit allfälligem Padding. Anderenfalls wird kein Padding erzeugt. Als Padding Zeichen wird '=' verwenet.

Als Alphabet für die Codierung wird 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' verwendet.

The application has to free the returned memory block.
Tests:
test1: Encode/Decode-Test.
Test function:
base64_encode_str2()
encode (version _str3)
Returns the base64 encoded representation of the input string
in_str.
Signature:
char *base64::encode(const char *in_str,bool padding,const char *sym,char pad)
Parameters:
| const char * | in_str | [IN] | a null-terminated string used as input for the encoder. |
| bool | padding | | wheter if padding schould be used or not. |
| const char * | sym | [IN] | a null-terminated array holding the symbols to be used for encoding. For standard base64 encoding, sym should be set to "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/". The array can be given as null-terminated string constant. Mind that the array has to contain exactly 64 characters. The function will fail, otherwise. All characters need to be different. |
| char | pad | | the padding character. For standard base64 encoding, pad should be set to '='. |
Return value:The base64 encoded representation of the input string
in_str.
Remarks:
The application has to free the returned memory block.
Tests:
test1: Encode/Decode-Test.
Test function:
base64_encode_str3()
encode (version _wcs1)
Returns the base64 encoded representation of the input string
in_str.
Signature:
char *base64::encode(const wchar_t *in_str)
Parameters:
| const wchar_t * | in_str | [IN] | a null-terminated string used as input for the encoder. |
Return value:The base64 encoded representation of the input string
in_str.
Remarks:
Die Funktion erzeugt einen base64 String mit allfälligem Padding. Als Padding Zeichen wird '=' verwenet.

Als Alphabet für die Codierung wird 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' verwendet.

The application has to free the returned memory block.
Tests:
test1: Encode/Decode-Test.
Test function:
base64_encode_wcs1()
encode (version _wcs2)
Returns the base64 encoded representation of the input string
in_str.
Signature:
char *base64::encode(const wchar_t *in_str,bool padding)
Parameters:
| const wchar_t * | in_str | [IN] | a null-terminated string used as input for the encoder. |
| bool | padding | | wheter if padding schould be used or not. |
Return value:The base64 encoded representation of the input string
in_str.
Remarks:
Falls
padding auf
true gesetzt wurde, erzeugt die Funktion einen base64 String mit allfälligem Padding. Anderenfalls wird kein Padding erzeugt. Als Padding Zeichen wird '=' verwenet.

Als Alphabet für die Codierung wird 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' verwendet.

The application has to free the returned memory block.
Tests:
test1: Encode/Decode-Test.
Test function:
base64_encode_wcs2()
encode (version _wcs3)
Returns the base64 encoded representation of the input string
in_str.
Signature:
char *base64::encode(const wchar_t *in_str,bool padding,const char *sym,char pad)
Parameters:
| const wchar_t * | in_str | [IN] | a null-terminated string used as input for the encoder. |
| bool | padding | | wheter if padding schould be used or not. |
| const char * | sym | [IN] | a null-terminated array holding the symbols to be used for encoding. For standard base64 encoding, sym should be set to "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/". The array can be given as null-terminated string constant. Mind that the array has to contain exactly 64 characters. The function will fail, otherwise. All characters need to be different. |
| char | pad | | the padding character. For standard base64 encoding, pad should be set to '='. |
Return value:The base64 encoded representation of the input string
in_str.
Remarks:
The application has to free the returned memory block.
Tests:
test1: Encode/Decode-Test.
Test function:
base64_encode_wcs3()
encode (version _alloc1)
Encodes the input from memory block
data and returns it as base64 encoded string.
Signature:
char *base64::encode(void *data,unsigned int length)
Parameters:
| void * | data | [IN] | The data to be encoded. |
| unsigned int | length | | The length in bytes of the data to be encoded. This mus not be 0. |
Remarks:
The application has to free the returned memory block.
Tests:
test1: Encode/Decode-Test.
Test function:
base64_encode_alloc1()
encode (version _alloc2)
Encodes the input from memory block
data and returns it as base64 encoded string.
Signature:
char *base64::encode(void *data,unsigned int length,bool padding)
Parameters:
| void * | data | [IN] | The data to be encoded. |
| unsigned int | length | | The length in bytes of the data to be encoded. This mus not be 0. |
| bool | padding | | wheter if padding schould be used or not. |
Remarks:
The application has to free the returned memory block.
Tests:
test1: Encode/Decode-Test.
Test function:
base64_encode_alloc2()
encode (version _alloc3)
Encodes the input from memory block
data and returns it as base64 encoded string.
Signature:
char *base64::encode(void *data,unsigned int length,bool padding,const char *sym,char pad)
Parameters:
| void * | data | [IN] | The data to be encoded. |
| unsigned int | length | | The length in bytes of the data to be encoded. This mus not be 0. |
| bool | padding | | wheter if padding schould be used or not. |
| const char * | sym | [IN] | a null-terminated array holding the symbols to be used for encoding. For standard base64 encoding, sym should be set to "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/". The array can be given as null-terminated string constant. Mind that the array has to contain exactly 64 characters. The function will fail, otherwise. All characters need to be different. |
| char | pad | | the padding character. For standard base64 encoding, pad should be set to '='. |
Remarks:
The application has to free the returned memory block.
Tests:
test1: Encode/Decode-Test.
Test function:
base64_encode_alloc3()
encode (version 1)
Encodes the input from memory block
data and writes the output to the existing memory block
bstr.
Signature:
int base64::encode(void *data,unsigned int length,char *bstr)
Parameters:
| void * | data | [IN] | The data to be encoded. |
| unsigned int | length | | The length in bytes of the data to be encoded. This mus not be 0. |
| char * | bstr | [OUT] | Receives the base64 encoded string. |
Return value:Returns 0 on successful execution.
Remarks:
Mind that
bstr has to be an already allocated memory block of sufficient size.
Tests:
test1: Encode/Decode-Test.
Test function:
base64_encode1()
encode (version 2)
Encodes the input from memory block
data and writes the output to the existing memory block
bstr.
Signature:
int base64::encode(void *data,unsigned int length,char *bstr,bool padding)
Parameters:
| void * | data | [IN] | The data to be encoded. |
| unsigned int | length | | The length in bytes of the data to be encoded. This mus not be 0. |
| char * | bstr | [OUT] | Receives the base64 encoded string. |
| bool | padding | | wheter if padding schould be used or not. |
Return value:Returns 0 on successful execution.
Remarks:
Mind that
bstr has to be an already allocated memory block of sufficient size.
Tests:
test1: Encode/Decode-Test.
Test function:
base64_encode2()
encode (version 3)
Encodes the input from memory block
data and writes the output to the existing memory block
bstr.
Signature:
int base64::encode(void *data,unsigned int length,char *bstr,bool padding,const char *sym,char pad)
Parameters:
| void * | data | [IN] | The data to be encoded. |
| unsigned int | length | | The length in bytes of the data to be encoded. This mus not be 0. |
| char * | bstr | [OUT] | Receives the base64 encoded string. |
| bool | padding | | wheter if padding schould be used or not. |
| const char * | sym | [IN] | a null-terminated array holding the symbols to be used for encoding. For standard base64 encoding, sym should be set to "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/". The array can be given as null-terminated string constant. Mind that the array has to contain exactly 64 characters. The function will fail, otherwise. All characters need to be different. |
| char | pad | | the padding character. For standard base64 encoding, pad should be set to '='. |
Return value:Returns 0 on successful execution.
Remarks:
Mind that
bstr has to be an already allocated memory block of sufficient size.
Tests:
test1: Encode/Decode-Test.
Test function:
base64_encode3()
encode (version _s1)
Encodes the input from memory block
data and writes the output to the existing memory block
bstr.
Signature:
int base64::encode(void *data,unsigned int length,char *bstr,unsigned int bln)
Parameters:
| void * | data | [IN] | The data to be encoded. |
| unsigned int | length | | The length in bytes of the data to be encoded. This mus not be 0. |
| char * | bstr | [OUT] | Receives the base64 encoded string. |
| unsigned int | bln | | Length of memory block bstr |
Tests:
test1: Encode/Decode-Test.
Test function:
base64_encode_s1()
encode (version _s2)
Encodes the input from memory block
data and writes the output to the existing memory block
bstr.
Signature:
int base64::encode(void *data,unsigned int length,char *bstr,unsigned int bln,bool padding)
Parameters:
| void * | data | [IN] | The data to be encoded. |
| unsigned int | length | | The length in bytes of the data to be encoded. This mus not be 0. |
| char * | bstr | [OUT] | Receives the base64 encoded string. |
| unsigned int | bln | | Length of memory block bstr |
| bool | padding | | wheter if padding schould be used or not. |
Tests:
test1: Encode/Decode-Test.
Test function:
base64_encode_s2()
encode (version _s3)
Encodes the input from memory block
data and writes the output to the existing memory block
bstr.
Signature:
int base64::encode(void *data,unsigned int length,char *bstr,unsigned int bln,bool padding,const char *sym,char pad)
Parameters:
| void * | data | [IN] | The data to be encoded. |
| unsigned int | length | | The length in bytes of the data to be encoded. This mus not be 0. |
| char * | bstr | [OUT] | Receives the base64 encoded string. |
| unsigned int | bln | | Length of memory block bstr |
| bool | padding | | wheter if padding schould be used or not. |
| const char * | sym | [IN] | a null-terminated array holding the symbols to be used for encoding. For standard base64 encoding, sym should be set to "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/". The array can be given as null-terminated string constant. Mind that the array has to contain exactly 64 characters. The function will fail, otherwise. All characters need to be different. |
| char | pad | | the padding character. For standard base64 encoding, pad should be set to '='. |
Tests:
test1: Encode/Decode-Test.
Test function:
base64_encode_s3()
encode (version _realloc1)
Encodes the input from memory block
data and writes the output to the existing memory block
bstr.
Signature:
int base64::encode(void *data,unsigned int length,char **bstr,unsigned int *bln)
Parameters:
| void * | data | [IN] | The data to be encoded. |
| unsigned int | length | | The length in bytes of the data to be encoded. This mus not be 0. |
| char ** | bstr | [OUT] | Receives the base64 encoded string. |
| unsigned int * | bln | [IN/OUT] | Length of memory block bstr |
encode (version _realloc2)
Encodes the input from memory block
data and writes the output to the existing memory block
bstr.
Signature:
int base64::encode(void *data,unsigned int length,char **bstr,unsigned int *bln,bool padding)
Parameters:
| void * | data | [IN] | The data to be encoded. |
| unsigned int | length | | The length in bytes of the data to be encoded. This mus not be 0. |
| char ** | bstr | [OUT] | Receives the base64 encoded string. |
| unsigned int * | bln | [IN/OUT] | Length of memory block bstr |
| bool | padding | | wheter if padding schould be used or not. |
encode (version _realloc3)
Encodes the input from memory block
data and writes the output to the existing memory block
bstr.
Signature:
int base64::encode(void *data,unsigned int length,char **bstr,unsigned int *bln,bool padding,const char *sym,char pad)
Parameters:
| void * | data | [IN] | The data to be encoded. |
| unsigned int | length | | The length in bytes of the data to be encoded. This mus not be 0. |
| char ** | bstr | [OUT] | Receives the base64 encoded string. |
| unsigned int * | bln | [IN/OUT] | Length of memory block bstr |
| bool | padding | | wheter if padding schould be used or not. |
| const char * | sym | [IN] | a null-terminated array holding the symbols to be used for encoding. For standard base64 encoding, sym should be set to "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/". The array can be given as null-terminated string constant. Mind that the array has to contain exactly 64 characters. The function will fail, otherwise. All characters need to be different. |
| char | pad | | the padding character. For standard base64 encoding, pad should be set to '='. |
encode_url (version 1)
Encodes the input from memory block
data and returns it as base64 encoded string.
Signature:
char *base64::encode_url(void *data,unsigned int length,bool padding)
Parameters:
| void * | data | [IN] | The data to be encoded. |
| unsigned int | length | | The length in bytes of the data to be encoded. This mus not be 0. |
| bool | padding | | wheter if padding schould be used or not. |
Remarks:
The application has to free the returned memory block.
encode_url (version 2)
Encodes the input from memory block
data and writes the output to the existing memory block
bstr.
Signature:
int base64::encode_url(void *data,unsigned int length,char *bstr,bool padding)
Parameters:
| void * | data | [IN] | The data to be encoded. |
| unsigned int | length | | The length in bytes of the data to be encoded. This mus not be 0. |
| char * | bstr | [OUT] | Receives the base64 encoded string. |
| bool | padding | | wheter if padding schould be used or not. |
encode_url (version 3)
Encodes the input from memory block
data and writes the output to the existing memory block
bstr.
Signature:
int base64::encode_url(void *data,unsigned int length,char *bstr,unsigned int bln,bool padding)
Parameters:
| void * | data | [IN] | The data to be encoded. |
| unsigned int | length | | The length in bytes of the data to be encoded. This mus not be 0. |
| char * | bstr | [OUT] | Receives the base64 encoded string. |
| unsigned int | bln | | Length of memory block bstr |
| bool | padding | | wheter if padding schould be used or not. |
encode_url (version 4)
Encodes the input from memory block
data and writes the output to the existing memory block
bstr.
Signature:
int base64::encode_url(void *data,unsigned int length,char **bstr,unsigned int *bln,bool padding)
Parameters:
| void * | data | [IN] | The data to be encoded. |
| unsigned int | length | | The length in bytes of the data to be encoded. This mus not be 0. |
| char ** | bstr | [OUT] | Receives the base64 encoded string. |
| unsigned int * | bln | [IN/OUT] | Length of memory block bstr |
| bool | padding | | wheter if padding schould be used or not. |
encode_length (version 1)
This function calculates the length (in bytes) of the encoded string.
Signature:
unsigned int base64::encode_length(unsigned int length)
Parameters:
| unsigned int | length | | The length in bytes of the data to be encoded. |
Return value:The length in bytes of the base64 encoded string.
encode_length (version 2)
This function calculates the length (in bytes) of the encoded string.
Signature:
unsigned int base64::encode_length(unsigned int length,bool padding)
Parameters:
| unsigned int | length | | The length in bytes of the data to be encoded. |
| bool | padding | | wheter if padding schould be used or not. |
Return value:The length in bytes of the base64 encoded string.
decode_length (version 1)
This function calculates the length (in bytes) of the decoded string.
The length of the encoded string has to be provided without padding!
Signature:
unsigned int base64::decode_length(unsigned int length)
Parameters:
| unsigned int | length | | The length in bytes of the base64 string to be decoded. |
Return value:The length in bytes of the decoded data.
decode_length (version 2)
This function calculates the length (in bytes) of the decoded string.
Signature:
unsigned int base64::decode_length(const char *bstr)
Parameters:
| const char * | bstr | [IN] | The base64 encoded string. |
Return value:The length in bytes of the decoded data.
decode (version 1)
Decodes the input from memory block
bstr and writes the output to the existing memory block
data.
Signature:
int base64::decode(const char *bstr,void *data)
Parameters:
| const char * | bstr | [IN] | The base64 encoded string. |
| void * | data | [OUT] | Receives the decoded data. |
Remarks:
Als Alphabet für die Codierung wird 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' verwendet.

Die Funktion erwartet einen base64 String mit allfälligem Padding. Als Padding Zeichen wird '=' verwenet.

Strict handling of non alphabet characters: Decoding will fail, if non alphabet characters are detected. Line breaks are not part of the base64 alphabet and also not allowed within base64 strings.

Mind that the memory block
data has to be already allocated and of sufficient size.
decode (version 2)
Decodes the input from memory block
bstr and writes the output to the existing memory block
data.
Signature:
int base64::decode(const char *bstr,void *data,const char *sym,char pad)
Parameters:
| const char * | bstr | [IN] | The base64 encoded string. |
| void * | data | [OUT] | Receives the decoded data. |
| const char * | sym | [IN] | a null-terminated array holding the symbols to be used for encoding. For standard base64 encoding, sym should be set to "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/". The array can be given as null-terminated string constant. Mind that the array has to contain exactly 64 characters. The function will fail, otherwise. All characters need to be different. |
| char | pad | | the padding character. For standard base64 encoding, pad should be set to '='. |
Remarks:
Strict handling of non alphabet characters: Decoding will fail, if non alphabet characters are detected. Line breaks are not part of the base64 alphabet and also not allowed within base64 strings.

Mind that the memory block
data has to be already allocated and of sufficient size.
decode (version _alloc1)
Decodes the input from memory block
bstr and returns the decoded data.
Signature:
void *base64::decode(const char *bstr)
Parameters:
| const char * | bstr | [IN] | The base64 encoded string. |
Remarks:
Als Alphabet für die Codierung wird 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' verwendet.

Die Funktion erwartet einen base64 String mit allfälligem Padding. Als Padding Zeichen wird '=' verwenet.

Strict handling of non alphabet characters: Decoding will fail, if non alphabet characters are detected. Line breaks are not part of the base64 alphabet and also not allowed within base64 strings.

The application has to free the returned memory block.
decode_string (version _alloc1_str)
Decodes the input from memory block
bstr and returns the decoded data.
This function adds a 0-byte at the end to the decoded data. This can be useful, if the data represents a string and should be null-terminated.
Signature:
char *base64::decode_string(const char *bstr)
Parameters:
| const char * | bstr | [IN] | The base64 encoded string. |
Remarks:
Als Alphabet für die Codierung wird 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' verwendet.

Die Funktion erwartet einen base64 String mit allfälligem Padding. Als Padding Zeichen wird '=' verwenet.

Strict handling of non alphabet characters: Decoding will fail, if non alphabet characters are detected. Line breaks are not part of the base64 alphabet and also not allowed within base64 strings.

The application has to free the returned memory block.
decode (version _alloc2)
Decodes the input from memory block
bstr and returns the decoded data.
Signature:
void *base64::decode(const char *bstr,const char *sym,char pad)
Parameters:
| const char * | bstr | [IN] | The base64 encoded string. |
| const char * | sym | [IN] | a null-terminated array holding the symbols to be used for encoding. For standard base64 encoding, sym should be set to "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/". The array can be given as null-terminated string constant. Mind that the array has to contain exactly 64 characters. The function will fail, otherwise. All characters need to be different. |
| char | pad | | the padding character. For standard base64 encoding, pad should be set to '='. |
Remarks:
Strict handling of non alphabet characters: Decoding will fail, if non alphabet characters are detected. Line breaks are not part of the base64 alphabet and also not allowed within base64 strings.

The application has to free the returned memory block.
decode (version _s1)
Decodes the input from memory block
bstr and writes the output to the existing memory block
data.
Signature:
int base64::decode(const char *bstr,void *data,unsigned int dataln)
Parameters:
| const char * | bstr | [IN] | The base64 encoded string. |
| void * | data | [OUT] | Receives the decoded data. |
| unsigned int | dataln | | The length of the memory block data. |
Remarks:
Als Alphabet für die Codierung wird 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' verwendet.

Die Funktion erwartet einen base64 String mit allfälligem Padding. Als Padding Zeichen wird '=' verwenet.

Strict handling of non alphabet characters: Decoding will fail, if non alphabet characters are detected. Line breaks are not part of the base64 alphabet and also not allowed within base64 strings.
decode (version _s2)
Decodes the input from memory block
bstr and writes the output to the existing memory block
data.
Signature:
int base64::decode(const char *bstr,void *data,unsigned int dataln,const char *sym,char pad)
Parameters:
| const char * | bstr | [IN] | The base64 encoded string. |
| void * | data | [OUT] | Receives the decoded data. |
| unsigned int | dataln | | The length of the memory block data. |
| const char * | sym | [IN] | a null-terminated array holding the symbols to be used for encoding. For standard base64 encoding, sym should be set to "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/". The array can be given as null-terminated string constant. Mind that the array has to contain exactly 64 characters. The function will fail, otherwise. All characters need to be different. |
| char | pad | | the padding character. For standard base64 encoding, pad should be set to '='. |
Remarks:
Strict handling of non alphabet characters: Decoding will fail, if non alphabet characters are detected. Line breaks are not part of the base64 alphabet and also not allowed within base64 strings.
decode (version _realloc1)
Decodes the input from memory block
bstr and writes the output to the existing memory block
data.
Signature:
int base64::decode(const char *bstr,void **data,unsigned int *dataln)
Parameters:
| const char * | bstr | [IN] | The base64 encoded string. |
| void ** | data | [OUT] | Receives the decoded data. |
| unsigned int * | dataln | [IN/OUT] | The length of the memory block data. |
Remarks:
Als Alphabet für die Codierung wird 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' verwendet.

Die Funktion erwartet einen base64 String mit allfälligem Padding. Als Padding Zeichen wird '=' verwenet.

Strict handling of non alphabet characters: Decoding will fail, if non alphabet characters are detected. Line breaks are not part of the base64 alphabet and also not allowed within base64 strings.
decode (version _realloc2)
Decodes the input from memory block
bstr and writes the output to the existing memory block
data.
Signature:
int base64::decode(const char *bstr,void **data,unsigned int *dataln,const char *sym,char pad)
Parameters:
| const char * | bstr | [IN] | The base64 encoded string. |
| void ** | data | [OUT] | Receives the decoded data. |
| unsigned int * | dataln | [IN/OUT] | The length of the memory block data. |
| const char * | sym | [IN] | a null-terminated array holding the symbols to be used for encoding. For standard base64 encoding, sym should be set to "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/". The array can be given as null-terminated string constant. Mind that the array has to contain exactly 64 characters. The function will fail, otherwise. All characters need to be different. |
| char | pad | | the padding character. For standard base64 encoding, pad should be set to '='. |
Remarks:
Strict handling of non alphabet characters: Decoding will fail, if non alphabet characters are detected. Line breaks are not part of the base64 alphabet and also not allowed within base64 strings.
decode_url (version 1)
Decodes the input from memory block
bstr and writes the output to the existing memory block
data.
Signature:
int base64::decode_url(const char *bstr,void *data)
Parameters:
| const char * | bstr | [IN] | The base64 encoded string. |
| void * | data | [OUT] | Receives the decoded data. |
Remarks:
Strict handling of non alphabet characters: Decoding will fail, if non alphabet characters are detected. Line breaks are not part of the base64 alphabet and also not allowed within base64 strings.

Mind that the memory block
data has to be already allocated and of sufficient size.
decode_url (version 2)
Decodes the input from memory block
bstr and writes the output to the existing memory block
data.
Signature:
void *base64::decode_url(const char *bstr)
Parameters:
| const char * | bstr | [IN] | The base64 encoded string. |
Remarks:
Strict handling of non alphabet characters: Decoding will fail, if non alphabet characters are detected. Line breaks are not part of the base64 alphabet and also not allowed within base64 strings.

The application has to free the returned memory block.
decode_url (version 3)
Encodes the input from memory block
data and writes the output to the existing memory block
bstr.
Signature:
int base64::decode_url(const char *bstr,void *data,unsigned int dataln)
Parameters:
| const char * | bstr | [IN] | The base64 encoded string. |
| void * | data | [OUT] | Receives the decoded data. |
| unsigned int | dataln | | The length of the memory block data. |
Remarks:
Strict handling of non alphabet characters: Decoding will fail, if non alphabet characters are detected. Line breaks are not part of the base64 alphabet and also not allowed within base64 strings.
decode_url (version 4)
Decodes the input from memory block
bstr and writes the output to the existing memory block
data.
Signature:
int base64::decode_url(const char *bstr,void **data,unsigned int *dataln)
Parameters:
| const char * | bstr | [IN] | The base64 encoded string. |
| void ** | data | [OUT] | Receives the decoded data. |
| unsigned int * | dataln | [IN/OUT] | The length of the memory block data. |
Remarks:
Strict handling of non alphabet characters: Decoding will fail, if non alphabet characters are detected. Line breaks are not part of the base64 alphabet and also not allowed within base64 strings.
main
Base64 encoder and decoder.
See
Commandline-Interface.
Signature:
int base64::main(int argc,char **argv)
Parameters:
| int | argc | | The number of command-line parameters. |
| char ** | argv | [IN] | The command-line parameters. |
Return value:Exit status.
Remarks:
Als Alphabet für die Codierung wird 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' verwendet.

Die Funktion erwartet einen base64 String mit allfälligem Padding. Als Padding Zeichen wird '=' verwenet.

Strict handling of non alphabet characters: Decoding will fail, if non alphabet characters are detected. Line breaks are not part of the base64 alphabet and also not allowed within base64 strings.