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

Function fletcher16_checksum

scapy/utils.py:618–627  ·  view source on GitHub ↗

Calculates Fletcher-16 checksum of the given buffer. Note: If the buffer contains the two checkbytes derived from the Fletcher-16 checksum # noqa: E501 the result of this function has to be 0. Otherwise the buffer has been corrupted. # noqa: E501

(binbuf)

Source from the content-addressed store, hash-verified

616
617@conf.commands.register
618def fletcher16_checksum(binbuf):
619 # type: (bytes) -> int
620 """Calculates Fletcher-16 checksum of the given buffer.
621
622 Note:
623 If the buffer contains the two checkbytes derived from the Fletcher-16 checksum # noqa: E501
624 the result of this function has to be 0. Otherwise the buffer has been corrupted. # noqa: E501
625 """
626 (c0, c1) = _fletcher16(binbuf)
627 return (c1 << 8) | c0
628
629
630@conf.commands.register

Callers

nothing calls this directly

Calls 1

_fletcher16Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…