Take a look at Cyclic Redundancy Checks beyond just copy/pasting an implementation. The underlying mathematical principles are very interesting, and you can try it yourself in Python!
Recently, the engineering team has needed to implement Cyclic Redundancy Checks (CRCs) for several different projects. The algorithm is easy enough to copy from the internet and forget, but my curiosity just couldn't quit there! CRCs have a very fascinating mathematical underpinning that relates to information theory, computer hardware and more. Trying to get a better understanding of CRCs eventually led me to discover the legendary ASCII text file called 'crc_v3.txt'.
You can find it here: http://www.ross.net/crc/download/crc_v3.txt
Alone 'crc_v3.txt' is a great read, but there are still a few points that might be hard to follow. To satiate my curiosity I created a follow-along Python script to demonstrate the math. You can check out the crc exploration on GitHub or by trying it out live in this post, thanks to the REPL.it widget below. Just click the green 'run' arrow and peruse the output, then try changing the code yourself!