How to XOR two strings that contain hex numbers in python?

前端 未结 3 961
轻奢々
轻奢々 2021-01-23 12:07

I have looked for an answer online, but none of them seem to solve my problem in my way (I know, I\'m picky :D).

Here\'s the deal: I am using the string type to store tw

3条回答
  •  面向向阳花
    2021-01-23 12:31

    1. Reverse both strings to s1_r and s2_r
    2. Do a char by char xor (char1 (from s1_r) xor char2 (from s2_r))
    3. Append result to xor_str
    4. Reverse xor_str

提交回复
热议问题