title: How to calculate CRC 16 with polynomial x16 + x12 + x5 + 1
body: <p>I am trying to interface with some system and in their specs they require to calculate CRC 16 for serial communication. Here is an extract from documentation </p>
  
  <p>"16 bit CCITT CRC of the message utilizing the standard polynomial, X16 +X12 +X5 +1. Seed values are always 0 (zero)"</p>
  
  <p>First of all I only found 2-3 samples of C# code of how to do it and none of the seem to give me the correct value. I tried this one <a href="http://www.sanity-free.com/133/crc_16_ccitt_in_csharp.html" rel="noreferrer">http://www.sanity-free.com/133/crc_16_ccitt_in_csharp.html</a>, but I am not sure what to set for initial value. I tried zeros and still doesn't work. </p>
  
  <p>Data I am testing it with is: </p>
  
  <pre><code>0x00 0x09 0x10 0x01 0x01 0x7C 0xF4 0xB8 0x00, 
  </code></pre>
  
  <p>the CRC value I get is </p>
  
  <pre><code>0xF2 0x24, 
  </code></pre>
  
  <p>however their system says it should be </p>
  
  <pre><code>0xC0 0x2F
  </code></pre>
  
  <p>My understanding is that polynomial x16 + x12 + x5 + 1 = 0x11021, however even when I use this one in the code it still gives me wrong answer. What am I doing wrong?</p>