Created
August 20, 2022 00:33
-
-
Save trycf/988897dcb533f472e69c5166406bf6dc to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
function urlSafeBase64Encode(str) { | |
return createObject("java", "java.util.Base64") | |
.getUrlEncoder() | |
.withoutPadding() | |
.encodeToString(str.getBytes("UTF-8")); | |
} | |
str = "subjects?_d=1" | |
base64 = toBase64(str); | |
writeDump({ "Standard Base64": base64}); | |
urlSafeBase64 = urlSafeBase64Encode(str); | |
writeDump({ "URL Safe Base64": urlSafeBase64 }); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment