@julia@eepy.moe @cpluspatch@fedi.cpluspatch.com It's not POSIX compliant
Conversation
Notices
-
Embed this notice
naskya::dev (dev@post.naskya.net)'s status on Saturday, 18-Nov-2023 11:13:08 JST naskya::dev -
Embed this notice
Julia :v_trans: :v_bi: (not cute) (julia@eepy.moe)'s status on Saturday, 18-Nov-2023 11:13:09 JST Julia :v_trans: :v_bi: (not cute) @cpluspatch@fedi.cpluspatch.com works, but is it posix compliant?
-
Embed this notice
Julia :v_trans: :v_bi: (not cute) (julia@eepy.moe)'s status on Saturday, 18-Nov-2023 11:13:09 JST Julia :v_trans: :v_bi: (not cute) @cpluspatch@fedi.cpluspatch.com I think the loop uses a bash extension
-
Embed this notice
Twinkie Pie [OXIDIZED] (cpluspatch@fedi.cpluspatch.com)'s status on Saturday, 18-Nov-2023 11:13:14 JST Twinkie Pie [OXIDIZED] @julia is this any useful or nah?
#!/bin/bash deobfuscate() { obfuscated=$1 deobfuscated="" hexKey=${obfuscated:0:2} key=$((16#$hexKey)) if [ -z "$key" ]; then echo "Invalid obfuscated string" return fi for (( i=2; i<${#obfuscated}; i+=2 )); do hexChar=${obfuscated:$i:2} char=$((16#$hexChar)) if [ -z "$char" ]; then echo "Invalid obfuscated string" return fi deobfuscated+=$(printf "\x$(printf %x $((char ^ key)))") done echo $deobfuscated } # Usage # deobfuscate "your_obfuscated_string" -
Embed this notice
Julia :v_trans: :v_bi: (not cute) (julia@eepy.moe)'s status on Saturday, 18-Nov-2023 11:13:15 JST Julia :v_trans: :v_bi: (not cute) Can someone help me port this typescript function to some really simple shell commands? It's used to obfuscate my email so scrapers don't spam the shit out of me, but I want to have an option for users that have JavaScript disabled. So, I was gonna provide a shell script that they could run instead of turning javascript on for my site.export function deobfuscate(obfuscated: string): string { let deobfuscated = ""; let hexKey = obfuscated.substring(0, 2); let key = parseInt(hexKey, 16); if (isNaN(key)) { throw new Error("Invalid obfuscated string"); } for (let i = 2; i < obfuscated.length; i += 2) { let hexChar = obfuscated.substring(i, i + 2); let char = parseInt(hexChar, 16); if (isNaN(char)) { throw new Error("Invalid obfuscated string"); } deobfuscated += String.fromCharCode(char ^ key); } return deobfuscated; }
-
Embed this notice