Returns the binary XOR of the 2 provided strings s1 and s2. s1 and s2 must be of same length.
(s1, s2)
| 707 | |
| 708 | |
| 709 | def strxor(s1, s2): |
| 710 | # type: (bytes, bytes) -> bytes |
| 711 | """ |
| 712 | Returns the binary XOR of the 2 provided strings s1 and s2. s1 and s2 |
| 713 | must be of same length. |
| 714 | """ |
| 715 | return b"".join(map(lambda x, y: struct.pack("!B", x ^ y), s1, s2)) |
| 716 | |
| 717 | |
| 718 | def strand(s1, s2): |
no test coverage detected