Created
July 18, 2016 01:47
-
-
Save jeanbaptistebeck/47b7c349db2c90b832a7ff0ab62fa3af to your computer and use it in GitHub Desktop.
Passphrase
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
def play_pass(str, n) | |
str | |
.downcase | |
.tr('a-z', ('a'..'z').to_a.rotate(n).join) | |
.tr('0-9', '9876543210') | |
.gsub(/(..|.$)/, &:capitalize) | |
.reverse | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment