MCPcopy Create free account
hub / github.com/secdev/scapy / hash

Method hash

scapy/layers/tls/session.py:969–977  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

967 # Python object management
968
969 def hash(self):
970 s1 = struct.pack("!H", self.sport)
971 s2 = struct.pack("!H", self.dport)
972 family = socket.AF_INET
973 if ':' in self.ipsrc:
974 family = socket.AF_INET6
975 s1 += inet_pton(family, self.ipsrc)
976 s2 += inet_pton(family, self.ipdst)
977 return strxor(s1, s2)
978
979 def eq(self, other):
980 ok = False

Callers 3

addMethod · 0.80
remMethod · 0.80
findMethod · 0.80

Calls 2

inet_ptonFunction · 0.90
strxorFunction · 0.90

Tested by

no test coverage detected