SyntaxFix
Write A Post
Hire A Developer
Questions
For bytearrays you can directly use XOR:
>>> b1 = bytearray("test123") >>> b2 = bytearray("321test") >>> b = bytearray(len(b1)) >>> for i in range(len(b1)): ... b[i] = b1[i] ^ b2[i] >>> b bytearray(b'GWB\x00TAG')