16 lines
521 B
Plaintext
16 lines
521 B
Plaintext
<cfparam name="d" default=""/>
|
|
|
|
<cftry>
|
|
<cfif structKeyExists(form,"enc")>
|
|
<cfset d=toBase64(d)/>
|
|
<cfelseif structKeyExists(form,"dec")>
|
|
<cfset d=ToString(ToBinary(d))/>
|
|
</cfif>
|
|
<cfcatch type="ANY"><cfoutput>#cfcatch.message# #cfcatch.detail#</cfoutput></cfcatch>
|
|
</cftry>
|
|
|
|
<form action="" method="POST">
|
|
<textarea name="d" rows="10" cols="90"><cfoutput>#d#</cfoutput></textarea>
|
|
<button type="submit" name="enc">Encode to Base64</button>
|
|
<button type="submit" name="dec">Decode from Base64</button>
|
|
</form> |