May-07-2024, 04:08 PM
hello
i am trying to implement an xor test on 2 values
in binary . I receive in return a strange numeric string instead
of the binary I expect in the code below -
what is wrong please?
thanks for your help
mik
===============
i am trying to implement an xor test on 2 values
in binary . I receive in return a strange numeric string instead
of the binary I expect in the code below -
what is wrong please?
thanks for your help
mik
===============
import re str_a ="ABCD" str_b ="JHGF" bin_a = ''.join(format(ord(i), '08b') for i in str_a) bin_b = ''.join(format(ord(i), '08b') for i in str_b) print(bin_a) print(bin_b) exore = int( bin_a) ^ int(bin_b) print(( exore ) , " -> binaire xoré ") # ---- output : 18991471129435296771915529226 -> binaire xoré