engines/adva_user/vendor/plugins/authentication/lib/radius/packet.rb
# Exclusive-or character by character two strings.
# returns a new string that is the xor of str1 and str2.  The
# two strings must be the same length.
Exclusive-or character by character two strings.
returns a new string that is the xor of str1 and str2.  The
two strings must be the same length.
Exclusive - or character by character two strings . returns a new string that is the xor of str1 and str2 . The two strings must be the same length .
def xor_str(str1, str2)
      i = 0
      newstr = ""
      str1.each_byte {
	|c1|
	c2 = str2[i]
	newstr = newstr << (c1 ^ c2)
	i = i+1
      }
      return(newstr)
    end
def xor_str ( str1 , str2 ) i = 0 newstr = "" str1 . each_byte { | c1 | c2 = str2 [ i ] newstr = newstr << ( c1 ^ c2 ) i = i + 1 } return ( newstr ) end
Exclusive-or character by character two strings.
Exclusive - or character by character two strings .
str1
str2