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

Function hexstr

scapy/utils.py:382–391  ·  view source on GitHub ↗

Build a fancy tcpdump like hex from bytes.

(p, onlyasc=0, onlyhex=0, color=False)

Source from the content-addressed store, hash-verified

380
381@conf.commands.register
382def hexstr(p, onlyasc=0, onlyhex=0, color=False):
383 # type: (Union[Packet, AnyStr], int, int, bool) -> str
384 """Build a fancy tcpdump like hex from bytes."""
385 x = bytes_encode(p)
386 s = []
387 if not onlyasc:
388 s.append(" ".join("%02X" % orb(b) for b in x))
389 if not onlyhex:
390 s.append(sane(x, color=color))
391 return " ".join(s)
392
393
394def repr_hex(s):

Callers 3

etherleakFunction · 0.90
linehexdumpFunction · 0.85
make_dump_txtMethod · 0.85

Calls 5

bytes_encodeFunction · 0.90
orbFunction · 0.90
saneFunction · 0.85
joinMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected