Advertisement
caubert

ROT13

Feb 11th, 2020
498
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.42 KB | None | 0 0
  1. {{ $text := lower (reReplace `\d+` (joinStr " " .CmdArgs) "") }} {{ $cipher := "" }}
  2. {{ range seq 0 (len $text) }}
  3.     {{ $ctext := index $text . }}
  4.     {{ if and (le $ctext 109) (not (eq $ctext 32) ) }}
  5.         {{ $ctext = add $ctext 13 }}
  6.     {{ else if eq $ctext 32 }}
  7.         {{ $ctext = 32 }}
  8.     {{ else }}
  9.         {{ $ctext = sub $ctext 13 }}
  10.     {{ end }}
  11. {{ $cipher = joinStr "" $cipher (printf "%c" $ctext) }}
  12. {{ end }}
  13. {{ $cipher }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement