DWC_Base64Decode

Syntax

#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 NULL is designated in dst, no conversion will occur and the maximum data size expected after the conversion will be returned. 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, where the three commonly used symbols, "+", "/" , and "=", are replaced by "." , "-" and "*".
This function can decode the 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 Size of the buffer used to store 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.
Other Actual size of the post-conversion data.

See Also

DWC_Base64Encode

Revision History

2007/10/05 Added explanation about the special type of Base64.
2006/07/24 Added a caution note.
2006/02/27 Changed description when changes were made to function arguments.
2006/01/18 Initial version.


CONFIDENTIAL