This documenta- tion describes the current state of development.
Note that interfaces and functionality may still change.

Prokee Modules:
  A
  B
  C
  D
  E
  F
  G
  I
  L
  M
  N
  O
  P
  R
  S
  T
  U
  W

     open all    |    close all

GUI Elements:
  B
  C
  I
  M
  P
  R
  S
  T

     open all    |    close all

GUI Interactions:
  B
  F
  H
  S

     open all    |    close all

GUI Layouts:
  L

     open all    |    close all

Games/Demos:
  M

     open all    |    close all

Third Party Libraries:
  P
  F
  Z

     open all    |    close all

Information about this Website / Informationen zu dieser Webseite:
In case of any questions, or comments, please feel free to contact me via email at apoll500@gmail.com.

Module base64 [Version: v01]

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.
encode (version _str1)
char *base64::encode(const char *in_str)
encode (version _str2)
char *base64::encode(const char *in_str,bool padding)
encode (version _str3)
char *base64::encode(const char *in_str,bool padding,const char *sym,char pad)
encode (version _wcs1)
char *base64::encode(const wchar_t *in_str)
encode (version _wcs2)
char *base64::encode(const wchar_t *in_str,bool padding)
encode (version _wcs3)
char *base64::encode(const wchar_t *in_str,bool padding,const char *sym,char pad)
The following methods returns a new allocated memory block, in which the output is written.
encode (version _alloc1)
char *base64::encode(void *data,unsigned int length)
encode (version _alloc2)
char *base64::encode(void *data,unsigned int length,bool padding)
encode (version _alloc3)
char *base64::encode(void *data,unsigned int length,bool padding,const char *sym,char pad)
The following methods write the encoded data into an existing memory block.
encode (version 1)
int base64::encode(void *data,unsigned int length,char *bstr)
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 _s1)
int base64::encode(void *data,unsigned int length,char *bstr,unsigned int bln)
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 _realloc1)
int base64::encode(void *data,unsigned int length,char **bstr,unsigned int *bln)
encode (version _realloc2)
int base64::encode(void *data,unsigned int length,char **bstr,unsigned int *bln,bool padding)
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 1)
char *base64::encode_url(void *data,unsigned int length,bool padding)
encode_url (version 2)
int base64::encode_url(void *data,unsigned int length,char *bstr,bool padding)
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.
encode_length (version 1)
unsigned int base64::encode_length(unsigned int length)
encode_length (version 2)
unsigned int base64::encode_length(unsigned int length,bool padding)
decode_length
Calculates the length of the decoded data.
decode_length (version 1)
unsigned int base64::decode_length(unsigned int length)
decode_length (version 2)
unsigned int base64::decode_length(const char *bstr)
decode
writing to existing memory block
decode (version 1)
int base64::decode(const char *bstr,void *data)
decode (version 2)
int base64::decode(const char *bstr,void *data,const char *sym,char pad)
allocating a new memory block
decode (version _alloc1)
void *base64::decode(const char *bstr)
decode_string (version _alloc1_str)
char *base64::decode_string(const char *bstr)
decode (version _alloc2)
void *base64::decode(const char *bstr,const char *sym,char pad)
writing to existing memory block with length check
decode (version _s1)
int base64::decode(const char *bstr,void *data,unsigned int dataln)
decode (version _s2)
int base64::decode(const char *bstr,void *data,unsigned int dataln,const char *sym,char pad)
reallocating version
decode (version _realloc1)
int base64::decode(const char *bstr,void **data,unsigned int *dataln)
decode (version _realloc2)
int base64::decode(const char *bstr,void **data,unsigned int *dataln,const char *sym,char pad)
decode_url
These versions are for url decoding
decode_url (version 1)
int base64::decode_url(const char *bstr,void *data)
decode_url (version 2)
void *base64::decode_url(const char *bstr)
decode_url (version 3)
int base64::decode_url(const char *bstr,void *data,unsigned int dataln)
decode_url (version 4)
int base64::decode_url(const char *bstr,void **data,unsigned int *dataln)
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:
Type Name Direction Description
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:
Type Name Direction Description
const char *in_str[IN]a null-terminated string used as input for the encoder.
bool paddingwheter 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:
Type Name Direction Description
const char *in_str[IN]a null-terminated string used as input for the encoder.
bool paddingwheter 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 padthe 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:
Type Name Direction Description
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:
Type Name Direction Description
const wchar_t *in_str[IN]a null-terminated string used as input for the encoder.
bool paddingwheter 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:
Type Name Direction Description
const wchar_t *in_str[IN]a null-terminated string used as input for the encoder.
bool paddingwheter 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 padthe 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:
Type Name Direction Description
void *data[IN]The data to be encoded.
unsigned int lengthThe 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:
Type Name Direction Description
void *data[IN]The data to be encoded.
unsigned int lengthThe length in bytes of the data to be encoded. This mus not be 0.
bool paddingwheter 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:
Type Name Direction Description
void *data[IN]The data to be encoded.
unsigned int lengthThe length in bytes of the data to be encoded. This mus not be 0.
bool paddingwheter 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 padthe 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:
Type Name Direction Description
void *data[IN]The data to be encoded.
unsigned int lengthThe 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:
Type Name Direction Description
void *data[IN]The data to be encoded.
unsigned int lengthThe length in bytes of the data to be encoded. This mus not be 0.
char *bstr[OUT]Receives the base64 encoded string.
bool paddingwheter 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:
Type Name Direction Description
void *data[IN]The data to be encoded.
unsigned int lengthThe length in bytes of the data to be encoded. This mus not be 0.
char *bstr[OUT]Receives the base64 encoded string.
bool paddingwheter 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 padthe 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:
Type Name Direction Description
void *data[IN]The data to be encoded.
unsigned int lengthThe length in bytes of the data to be encoded. This mus not be 0.
char *bstr[OUT]Receives the base64 encoded string.
unsigned int blnLength 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:
Type Name Direction Description
void *data[IN]The data to be encoded.
unsigned int lengthThe length in bytes of the data to be encoded. This mus not be 0.
char *bstr[OUT]Receives the base64 encoded string.
unsigned int blnLength of memory block bstr
bool paddingwheter 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:
Type Name Direction Description
void *data[IN]The data to be encoded.
unsigned int lengthThe length in bytes of the data to be encoded. This mus not be 0.
char *bstr[OUT]Receives the base64 encoded string.
unsigned int blnLength of memory block bstr
bool paddingwheter 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 padthe 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:
Type Name Direction Description
void *data[IN]The data to be encoded.
unsigned int lengthThe 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:
Type Name Direction Description
void *data[IN]The data to be encoded.
unsigned int lengthThe 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 paddingwheter 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:
Type Name Direction Description
void *data[IN]The data to be encoded.
unsigned int lengthThe 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 paddingwheter 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 padthe 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:
Type Name Direction Description
void *data[IN]The data to be encoded.
unsigned int lengthThe length in bytes of the data to be encoded. This mus not be 0.
bool paddingwheter 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:
Type Name Direction Description
void *data[IN]The data to be encoded.
unsigned int lengthThe length in bytes of the data to be encoded. This mus not be 0.
char *bstr[OUT]Receives the base64 encoded string.
bool paddingwheter 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:
Type Name Direction Description
void *data[IN]The data to be encoded.
unsigned int lengthThe length in bytes of the data to be encoded. This mus not be 0.
char *bstr[OUT]Receives the base64 encoded string.
unsigned int blnLength of memory block bstr
bool paddingwheter 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:
Type Name Direction Description
void *data[IN]The data to be encoded.
unsigned int lengthThe 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 paddingwheter 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:
Type Name Direction Description
unsigned int lengthThe 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:
Type Name Direction Description
unsigned int lengthThe length in bytes of the data to be encoded.
bool paddingwheter 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:
Type Name Direction Description
unsigned int lengthThe 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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
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 padthe 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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
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 padthe 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:
Type Name Direction Description
const char *bstr[IN]The base64 encoded string.
void *data[OUT]Receives the decoded data.
unsigned int datalnThe 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:
Type Name Direction Description
const char *bstr[IN]The base64 encoded string.
void *data[OUT]Receives the decoded data.
unsigned int datalnThe 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 padthe 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:
Type Name Direction Description
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:
Type Name Direction Description
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 padthe 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:
Type Name Direction Description
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:
Type Name Direction Description
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:
Type Name Direction Description
const char *bstr[IN]The base64 encoded string.
void *data[OUT]Receives the decoded data.
unsigned int datalnThe 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:
Type Name Direction Description
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:
Type Name Direction Description
int argcThe 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.


Copyright © 2017 - 2019 by Andreas Pollhammer