Calculates the Base64 representation of a string or binary object. The Base64 format uses printable characters, allowing binary data to be sent in forms and e-mail, and stored in a database or file.
The Base64 representation of a string or binary object.
Conversion functions, String functions
ToBase64(strOrBin [, encoding])
ColdFusion (2018 release): Introduced named parameters.
ColdFusion MX: Added the encoding parameter.
Parameter |
Description |
|---|---|
strOrBin |
A string, the name of a string, or a binary object. |
encoding |
For a string, defines how characters are represented in a byte array. The following list includes commonly used values:
|
Adobe recommends that you use the BinaryEncode function to convert binary data to Base64-encoded data in all new applications.
<cfscript>
myid="johndoe"
mypwd="john@123"
myEncodedPwd=ToBase64(myid & ":" & mypwd)
writeOutput(myEncodedPwd)
</cfscript>
Sign in to your account