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)
| 616 | |
| 617 | @conf.commands.register |
| 618 | def 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…