(charbuf)
| 602 | |
| 603 | |
| 604 | def _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 |
no outgoing calls
no test coverage detected
searching dependent graphs…