Base64Encode Function

Microchip TCP/IP Stack

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

Encodes a binary array to Base-64.

Preconditions

None

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

Number of encoded bytes written to cDestData. This will always be a multiple of 4.

Remarks

Encoding cannot be performed in-place. If cSourceData overlaps with cDestData, the behavior is undefined. 

Encoded data is always at least 1/3 larger than the source data. It may be 1 or 2 bytes larger than that.

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