Module: Tweetwine::Obfuscate

Extended by:
Obfuscate
Included in:
Obfuscate
Defined in:
lib/tweetwine/obfuscate.rb

Instance Method Summary collapse

Instance Method Details

#obfuscate(str) ⇒ Object



9
10
11
# File 'lib/tweetwine/obfuscate.rb', line 9

def obfuscate(str)
  str.tr("\x21-\x7e", "\x50-\x7e\x21-\x4f")
end

#read(str) ⇒ Object



13
14
15
# File 'lib/tweetwine/obfuscate.rb', line 13

def read(str)
  obfuscate(Base64.decode64(str))
end

#write(str) ⇒ Object



17
18
19
# File 'lib/tweetwine/obfuscate.rb', line 17

def write(str)
  Base64.encode64(obfuscate(str))
end