Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Rotate13(t)
- local byte_a, byte_A = string.byte('a'), string.byte('A')
- return (string.gsub(t, "[%a]",
- function (char)
- local offset = (char < 'a') and byte_A or byte_a
- local b = string.byte(char) - offset -- 0 to 25
- b = math.mod(b + 13, 26) + offset -- Rotate
- return string.char(b)
- end
- ))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement