title: deserialize function ( byte array to uint32 )
body: <p>Whats the best way to write a deserialize function to convert a byte array into a 32 bit unsigned integer?</p>
  
  <pre><code>    typedef unsigned long  uint32;
  
      uint32 deserialize_uint32(unsigned char *buffer)
      {
          uint32 value = 0;
  
          value |= buffer[0] &lt;&lt; 24;
          value |= buffer[1] &lt;&lt; 16;
          value |= buffer[2] &lt;&lt; 8;
          value |= buffer[3];
          return value;
  
      }
  
      unsigned char* deserialize_uint32B(unsigned char *buffer, uint32* value)
      {
          *value = 0;
  
          *value |= buffer[0] &lt;&lt; 24;
          *value |= buffer[1] &lt;&lt; 16;
          *value |= buffer[2] &lt;&lt; 8;
          *value |= buffer[3];
          return buffer + 4;
      }
  </code></pre>
  
  <p>thanks! or if there's even a better way please let me know.. thanks !</p>