Last active
October 17, 2015 20:53
-
-
Save pervognsen/30872f170eefa98c6c27 to your computer and use it in GitHub Desktop.
for jp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from string import maketrans, ascii_lowercase as lc, ascii_uppercase as uc | |
rots = [maketrans(lc + uc, lc[n:] + lc[:n] + uc[n:] + uc[:n]) for n in range(26)] | |
def rot(s, n): return s.translate(rots[n % 26]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment