SparkFun will be closed Friday 7/3/2020 for the 4th of July holiday. All orders placed after 2 pm MT on Thursday 7/2/2020 will be shipped out on Monday 7/6/2020. SparkFun Support will also resume on Monday 7/6/2020. Have a safe holiday!
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!