MCPcopy Index your code
hub / github.com/secdev/scapy / strxor

Function strxor

scapy/utils.py:709–715  ·  view source on GitHub ↗

Returns the binary XOR of the 2 provided strings s1 and s2. s1 and s2 must be of same length.

(s1, s2)

Source from the content-addressed store, hash-verified

707
708
709def 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
718def strand(s1, s2):

Callers 12

teredoAddrExtractInfoFunction · 0.90
in6_xorFunction · 0.90
hashretMethod · 0.90
decryptMethod · 0.90
encryptMethod · 0.90
GSS_WrapExMethod · 0.90
GSS_UnwrapExMethod · 0.90
hashretMethod · 0.90
hashMethod · 0.90
_tls_PRFFunction · 0.90
_get_nonceMethod · 0.90
in4_cidr2maskFunction · 0.85

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected