unsigned is not always 4 bytes. Use boost::uint32_t