Skip to content

Commit

Permalink
Url aggressive decode fix & base64 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ghluka committed Jul 10, 2024
1 parent 3badcb5 commit bde69ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions techdemos/encode/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const output = document.getElementById("outputText");

const codes = {
"Base64": {
encode: btoa,
decode: atob
encode: text => btoa(text),
decode: text => atob(text)
},
"Base16 (Hexadecimal)": {
encode: text => text.split("").map(c => c.charCodeAt(0).toString(16).padStart(2, "0")).join("").toUpperCase(),
Expand Down Expand Up @@ -43,7 +43,7 @@ const codes = {
},
"URL (Aggressive)": {
encode: encodeURIAggressive,
decode: text => decodeURIComponent(decodeURI(text))
decode: text => decodeURIComponent(decodeURI(decodeURIComponent(text).replaceAll("%", "%"))).replaceAll("%", "%")
},
"URL (Aggressive, non destructive)": {
encode: encodeURINonDestructive,
Expand Down

0 comments on commit bde69ef

Please sign in to comment.