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 Data size of the data to convert.
dst Pointer to the buffer used to store the post-conversion data.
dstlen Size (length of the string) of the buffer used to store the data after conversion.

Return Values

-1 Conversion failed.
The maximum length of the string expected after the conversion exceeds the value of the dstlen argument.
Zero or greater The actual size (string length) of the post-conversion data.

Description

This function encodes the data designated with src in Base64 and outputs it as a char-type character string.

If NULL is designated in dst, no conversion will occur and the maximum character string length expected after the conversion is returned as the return value. The maximum string length is the value for the worst-case conversion. The actual length is often smaller after conversion.

The string after conversion does not include a NULL terminator.

This function uses a special type of Base64. You must use the DWC_Base64Decode function to decode data encoded with this function.

Revision History


CONFIDENTIAL