Advertisement
opexxx

xor.rb

Apr 23rd, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.11 KB | None | 0 0
  1. def xor(str, key)
  2. str.split(//).collect {|e| [e.unpack('C').first ^ (key.to_i & 0xFF)].pack('C') }.join
  3. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement