User Guide

546 CFML Language Reference
<!----------------------------------------------------------------------
Create a Base 64 representation of this string.
----------------------------------------------------------------------->
<CFSET data64=toBase64(charData)>
<!----------------------------------------------------------------------
Convert string to binary.
----------------------------------------------------------------------->
<CFSET binaryData=toBinary(data64)>
<!----------------------------------------------------------------------
Convert binary back to Base 64.
----------------------------------------------------------------------->
<CFSET another64=toBase64(binaryData)>
<!----------------------------------------------------------------------
Compare another64 with data64 to ensure that they are equal.
----------------------------------------------------------------------->
<CFIF another64 eq data64>
<H3>Base 64 representation of binary data is identical to the Base 64
representation of string data.</H3>
<CFELSE>
<H3>Conversion error.</H3>
</CFIF>
</BODY>
</HTML>