title: How to compute a crc16 on a struct
body: <p>I recently read some papers and code on crc computation (e.g. <a href="http://www.ross.net/crc/download/crc_v3.txt" rel="nofollow noreferrer">A PAINLESS GUIDE TO CRC ERROR DETECTION ALGORITHMS</a> and <a href="http://lxr.free-electrons.com/source/lib/crc16.c#L65" rel="nofollow noreferrer">the implementation in Linux</a>). As far as I understand, crc is done byte by byte starting on a certain address.</p>
  
  <p>example from Linux Kernel:</p>
  
  <pre><code>u16 crc16(u16 crc, u8 const *buffer, size_t len)
  {
      while (len--)
      crc = crc16_byte(crc, *buffer++);
      return crc;
  }
  </code></pre>
  
  <p>Now I am asking myself is it possible to do this easily with a <code>struct</code>?</p>