Skip to content

Instantly share code, notes, and snippets.

@maxd
Created April 4, 2014 14:38
Show Gist options
  • Save maxd/9976009 to your computer and use it in GitHub Desktop.
Save maxd/9976009 to your computer and use it in GitHub Desktop.
Patch to fix compatibility of radiustar with ruby 2.x
require 'radiustar'
module Radiustar
class Packet
def xor_str(str1, str2)
bstr1 = str1.unpack('C*')
bstr2 = str2.unpack('C*')
bstr1.zip(bstr2).map {|b1, b2| b1 ^ b2}.pack('C*')
end
end
end
Copy link

ghost commented Apr 4, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment