Skip to content

Instantly share code, notes, and snippets.

@jeanbaptistebeck
Created July 18, 2016 01:47
Show Gist options
  • Save jeanbaptistebeck/47b7c349db2c90b832a7ff0ab62fa3af to your computer and use it in GitHub Desktop.
Save jeanbaptistebeck/47b7c349db2c90b832a7ff0ab62fa3af to your computer and use it in GitHub Desktop.
Passphrase
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