From Torben's Wiki
XOR
xor(a, b) # Same as a ^ b.
char <-> int
i = ord (c)
c = chr(i)
def dec2hex(n):
# n is integer!
return "%X" % n
def hex2dec(s):
# s is string!
return int(s, 16)
print dec2hex(255) # FF
print hex2dec('FF') # 255
print hex(255) # 0xff
print hex2dec('0xff') # 255