Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexander AlexanderFisenko

View GitHub Profile
View rot13.rb
def rot13(string)
a = 'a'.ord
z = 'z'.ord
capital_a = 'A'.ord
capital_z = 'Z'.ord
decyphered_string = ""
string.unpack('c*').each do |char|
if (a..z).cover?(char)
modified_char = (((char - a) + 13) % 26) + a
You can’t perform that action at this time.