DWC_Base64Decode

C Specification

#include <dwc.h>

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

Description

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

If a 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 the worst-case conversion efficiency; 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.

Arguments

src Pointer to the Base64 data to convert.
srclen The data size (the character string length) of the Base64 data to convert.
dst Pointer to the buffer used to store the post-conversion data.
dstlen The 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 post-conversion data.

See Also

DWC_Base64Encode

Revision History

07/24/2006 Added a caution note
02/27/2006 Changed description when changes were made to function arguments
01/18/2006 Initial version


CONFIDENTIAL