| 1 | initial version |
There is no need to convert to binary to perform XOR, converting to a numerical value is enough. For example,
H=HexadecimalStrings()
A=H('4ac0')
B=H('b53f')
hex( eval('0x'+str(A)) ^^ eval('0x'+str(B)) )
gives 0xffff. If element of H is needed, one can use
H( hex( eval('0x'+str(A)) ^^ eval('0x'+str(B)) )[2:] )
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.