DWC_Base64Encode

Syntax

#include <dwc.h>
int DWC_Base64Encode(const char *src,
                     const unsigned long srclen,
                     char *dst,
                     const unsigned long dstlen);

Arguments

src Pointer to the data to convert.
srclen Byte size of the conversion source data.
dst Pointer to the buffer that will store the post-conversion Base64 string.
dstlen Byte size of the buffer that will store the post-conversion Base64 string.

Return Values

-1 Conversion failed.
Length of the post-conversion Base64 string exceeds the value of the dstlen argument.
Other Length of the post-conversion Base64 string.

Description

Encodes the data specified by src in Base64 and outputs a Base64 string.

If NULL is specified for dst, the conversion process does not actually execute, but the function returns what the length of the Base64 string would have been after conversion.

The post-conversion Base64 string does not include a NULL terminator.

This function uses a special type of Base64, where the three commonly used symbols "+", "/" , and "=" are replaced by "." , "-", and "*".
You must use the DWC_Base64Decode function to decode Base64 strings that have been encoded with this function.

See Also

DWC_Base64Decode

Revision History

For the changelog prior to 5.1 PR2, click here.


CONFIDENTIAL