title: Difference between crc32() implementations of <linux/crc32.h> and <zlib.h> in C
body: <p>I am calling two functions on my <code>char* s = "pratik"</code> as:  </p>
  
  <p>User code:  </p>
  
  <pre><code>#include &lt;zlib.h&gt;
  int main()
  {
      char *s = "pratik";
      printf("%x\n",crc32(0x80000000, s, strlen(s)));
      return 0;
  }
  </code></pre>
  
  <p>Output:
  66fa3c99</p>
  
  <p>Kernel code:  </p>
  
  <pre><code>#include &lt;linux/crc32.h&gt;
  
  int main()
  {
      char *s = "pratik";
  
      u32 checksum = crc32(0x80000000, s, strlen(s));
      printk("\nChecksum --&gt; %x", checksum);
  
      return checksum;
  }
  </code></pre>
  
  <p>Output:</p>
  
  <p>Checksum --> d7389d3a   </p>
  
  <p>Why are the values of the checksums on the same strings different?</p>