title: How is a CRC32 checksum calculated?
body: <p>Maybe I'm just not seeing it, but CRC32 seems either needlessly complicated, or insufficiently explained anywhere I could find on the web.</p>
  
  <p>I understand that it is the remainder from a non-carry-based arithmetic division of the message value, divided by the (generator) polynomial, but the actual implementation of it escapes me.</p>
  
  <p>I've read <a href="http://www.ross.net/crc/crcpaper.html" rel="noreferrer">A Painless Guide To CRC Error Detection Algorithms</a>, and I must say it was not painless. It goes over the theory rather well, but the author never gets to a simple "this is it." He does say what the parameters are for the standard CRC32 algorithm, but he neglects to lay out clearly how you get to it.</p>
  
  <p>The part that gets me is when he says "this is it" and then adds on, "oh by the way, it can be reversed or started with different initial conditions," and doesn't give a clear answer of what the final way of calculating a CRC32 checksum given all of the changes he just added.</p>
  
  <ul>
  <li>Is there a simpler explanation of how CRC32 is calculated?</li>
  </ul>
  
  <p>I attempted to code in C how the table is formed:</p>
  
  <pre><code>for (i = 0; i &lt; 256; i++)
  {
      temp = i;
  
      for (j = 0; j &lt; 8; j++)
      {
          if (temp &amp; 1)
          {
              temp &gt;&gt;= 1;
              temp ^= 0xEDB88320;
          }
          else {temp &gt;&gt;= 1;}
      }
      testcrc[i] = temp;
  }
  </code></pre>
  
  <p>but this seems to generate values inconsistent with values I have found elsewhere on the Internet. I <strong>could</strong> use the values I found online, but I want to understand how they were created.</p>
  
  <p>Any help in clearing up these incredibly confusing numbers would be <strong>very</strong> appreciated.</p>