Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fixed_xor(s1, s2):
- res = ''
- for i in range(len(s1)):
- # # convert hex numbers to decimal
- i1, i2 = int(s1[i], 16), int(s2[i], 16)
- # evaluate xor product
- xor = i1 ^ i2
- # convert decimal back to hex
- xor_s = hex(xor)
- # remove '0x' in the beginning of the string
- xor_s = xor_s[2:]
- # append to result
- res += xor_s
- return res
- if __name__ == "__main__":
- s1 = input()
- s2 = input()
- result = fixed_xor(s1, s2)
- print(result)
Add Comment
Please, Sign In to add comment