How to simply reconstruct numbers from a buffer in little endian format
<p>Suppose I have: </p>

<pre><code>typedef unsigned long long uint64;

unsigned char data[BUF_SIZE];    

uint64 MyPacket::GetCRC()
{
  return (uint64)(data[45] | data[46] &lt;&lt; 8 | 
         data[47] &lt;&lt; 16 | data[48] &lt;&lt; 24 |
         (uint64)data[49] &lt;&lt; 32| (uint64)data[50] &lt;&lt; 40 |
         (uint64)data[51] &lt;&lt; 48| (uint64)data[52] &lt;&lt; 56);
}
</code></pre>

<p>Just wondering, if there is an cleaner way.  I tried a memcpy to an uint64 variable 
but that gives me the wrong value.  I think I need the reverse.  The data is in little endian format.</p>
