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.