hex string into binary format?

Tertius Cronje Tertius.Cronje at postoffice.co.za
Thu Mar 31 09:03:56 EST 2005


Hi, 

How do I get a hexvalued string to a format recognized for binary
calculation?


import binascii
s1 = '1C46BE3D9F6AA820'
s2 = '8667B5236D89CD46'

i1 = binascii.unhexlify(s1)
i2 = binascii.unhexlify(s2)
x = i1 ^i2

	TypeError: unsupported operand type(s) for ^: 'str' and 'str'

Many TIA
T



More information about the Python-list mailing list