Base64Decode Function

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
Base64Decode Function
C
WORD Base64Decode(
    BYTE* cSourceData, 
    WORD wSourceLen, 
    BYTE* cDestData, 
    WORD wDestLen
);
Description

Decodes a Base-64 array to its literal representation.

Preconditions

None

Parameters
Parameters 
Description 
cSourceData 
Pointer to a string of Base-64 encoded data 
wSourceLen 
Length of the Base-64 source data Maximum length that can be written to cDestData 
cDestData 
Pointer to write the decoded data 
Returns

Number of decoded bytes written to cDestData.

Remarks

This function is binary safe and will ignore invalid characters (CR, LF, etc). If cSourceData is equal to cDestData, the data will be converted in-place. If cSourceData is not equal to cDestData, but the regions overlap, the behavior is undefined. 

Decoded data is always at least 1/4 smaller than the source data.

Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.