For example, the displacement instruction is to shift the binary number 10010110 to the right, round off the end, add 0 to the first, 0 → 10010110, and the result is 01001011
I have tested the code shared by another post administrator. The CRC result generated by modulo-2 division is not ideal, so I insist on writing cyclic redundancy method. The attached figure shows the CRC results of unsatisfactory errors.
In the case of where you fed the program a byte sequence including 256 as a byte value, be aware that unsigned byte values should run from 0 to 255, so 256 is wrong.
Should the app complain about that, or silently "clean" it up?