Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 0 years ago

Max Alekseyev gravatar image

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:] )