Guiliani  Version 2.6 revision 7293 (documentation build 12)
CGUIBase64 Class Reference

Base64 encoder/decoder for Guiliani. More...

#include <GUIBase64.h>

Static Public Member Functions

static eC_Int Decode (eC_UByte *pubBuf, const eC_UInt uiBufLen, const eC_Char *pcIn)
 
static eC_Char * Encode (eC_Char *pcBuf, const eC_UInt uiBufLen, const eC_UByte *pubIn, const eC_UInt uiSrcLen)
 

Detailed Description

Base64 encoder/decoder for Guiliani.

All binary input is supported, not just ASCII.

Member Function Documentation

◆ Decode()

static eC_Int CGUIBase64::Decode ( eC_UByte *  pubBuf,
const eC_UInt  uiBufLen,
const eC_Char *  pcIn 
)
static

Decodes a base64 data stream to a stream of characters.

The output buffer's (pubBuf) size should be at least strlen(pcIn) * 3 / 4 bytes. Check return value afterwards to get the exact number of decoded bytes.

Parameters
pubBuf[out] Output buffer containing decoded data.
uiBufLenThe size of the output buffer in bytes.
pcInInput base64 data stream.
Returns
Number of bytes decoded to pubBuf, or -1 in case of error

◆ Encode()

static eC_Char * CGUIBase64::Encode ( eC_Char *  pcBuf,
const eC_UInt  uiBufLen,
const eC_UByte *  pubIn,
const eC_UInt  uiSrcLen 
)
static

Encodes a stream of values to a base64 data stream.

To encode a value stream (pubIn) to a base64 stream, it is necessary to allocate the output buffer before.

The output buffer's (uiBufLen) size should be at least uiSrcLen * 4 / 3 + 4Byte-Padding bytes. You can use the GETBASE64BUFFERSIZE helper macro to get a sufficient size.

Parameters
pcBuf[out] Pointer to the preallocated output buffer. After this method finished, this buffer contains the zero terminated base64 string.
uiBufLenThe size of the output buffer in bytes.
pubInInput buffer to encode.
uiSrcLenNumber of characters of the input buffer to be encoded.
Returns
Pointer to output buffer (same as pcBuf).

The documentation for this class was generated from the following file: