Function to Calculate a CRC16 Checksum

There are several details you need to ‘match up’ with for a particular CRC implementation – even using the same polynomial there can be different results because of minor differences in how data bits are handled, using a particular initial value for the CRC (sometimes it’s zero, sometimes 0xffff), and/or inverting the bits of the … Read more

How to generate a CRC-16 from C#

Here we go; note that this is a specific flavor of CRC-16 – it is confusing to say just “CRC-16”. This borrows some implementation specifics from http://www.sanity-free.com/ – note I have made it static rather than instance-based. using System; static class Program { static void Main() { string input = “8000”; var bytes = HexToBytes(input); … Read more