Sha256: 7b24c56449155572295640836643ddba700e58ce043e4aa9de1bb2dbd2567f87
Contents?: true
Size: 378 Bytes
Versions: 1
Compression:
Stored size: 378 Bytes
Contents
module Encrubto::Rot13 class Encryptor ORI = 'abcdefghijklmnopqrstuvwxyz' ROT = 'nopqrstuvwxyzabcdefghijklm' def encrypt(str) if str.is_a? String str.tr("#{ ORI }#{ ORI.upcase }", "#{ ROT }#{ ROT.upcase }") else raise 'Param must be String!' end end def decrypt(encrypted) encrypt(encrypted) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
encrubto-0.2.0 | lib/encrubto/rot13/encryptor.rb |