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

Method i2repr

scapy/fields.py:1162–1169  ·  view source on GitHub ↗
(self, pkt, x)

Source from the content-addressed store, hash-verified

1160
1161class XNBytesField(NBytesField):
1162 def i2repr(self, pkt, x):
1163 # type: (Optional[Packet], int) -> str
1164 if isinstance(x, int):
1165 return '0x%x' % x
1166 # x can be a tuple when coming from struct.unpack (from getfield)
1167 if isinstance(x, (list, tuple)):
1168 return "0x" + "".join("%02x" % b for b in x)
1169 return super(XNBytesField, self).i2repr(pkt, x)
1170
1171
1172class SignedByteField(Field[int, int]):

Callers

nothing calls this directly

Calls 2

joinMethod · 0.80
i2reprMethod · 0.45

Tested by

no test coverage detected