A becomes N, N becomes A. Because the alphabet has 26 letters, applying it twice restores the original, so one function both encodes and decodes.
Digits, punctuation, and spacing are left untouched.
ROT13 rotates each letter 13 places through the alphabet. Applying it twice returns the original text.
A becomes N, N becomes A. Because the alphabet has 26 letters, applying it twice restores the original, so one function both encodes and decodes.
Digits, punctuation, and spacing are left untouched.