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

Function _fletcher16

scapy/utils.py:604–614  ·  view source on GitHub ↗
(charbuf)

Source from the content-addressed store, hash-verified

602
603
604def _fletcher16(charbuf):
605 # type: (bytes) -> Tuple[int, int]
606 # This is based on the GPLed C implementation in Zebra <http://www.zebra.org/> # noqa: E501
607 c0 = c1 = 0
608 for char in charbuf:
609 c0 += char
610 c1 += c0
611
612 c0 %= 255
613 c1 %= 255
614 return (c0, c1)
615
616
617@conf.commands.register

Callers 2

fletcher16_checksumFunction · 0.85
fletcher16_checkbytesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…