DWC_Base64Decode

Syntax

#include <dwc.h>

int DWC_Base64Decode(const char *src,
                     const unsigned long srclen,
                     char *dst,
                     const unsigned long dstlen);

Arguments

src Pointer to the Base64 data to convert.
srclen The data size (string length) of the Base64 data to convert.
dst Pointer to the buffer used to store the post-conversion data.
dstlen Size of the buffer used to store the post-conversion data.

Return Values

-1 Conversion failed.
Either the maximum data size expected after the conversion exceeded the value of the dstlen argument, or the srclen argument was not a multiple of four.
Zero or greater The actual size of the data after conversion.

Description

This function decodes the Base64 data designated with src and outputs it as char-type data.

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

This function uses a special type of Base64. This function can decode data that has been encoded with the DWC_Base64Encode function.

Revision History


CONFIDENTIAL