View difference between Paste ID: nsTaqk1Q and L73wHypz
SHOW: | | - or go back to the newest paste.
1
-- Caesar api by Mackan90096
2
3
function encrypt(text, key)
4
	return text:gsub("%a", function(t)
5
			local base = (t:lower() == t and string.byte('a') or string.byte('A'))
6
 
7
			local r = t:byte() - base
8
			r = r + key
9
			r = r%26
10
			r = r + base
11
			return string.char(r)
12
		end)
13
end
14
 
15
function decrypt(text, key)
16
	return encrypt(text, -key)
17
end