p-ranav / alpaca

Serialization library written in C++17 - Pack C++ structs into a compact byte-array without any macros or boilerplate code
MIT License
479 stars 43 forks source link

fix: crc32 should not have byte order be platform dependent #49

Closed finger563 closed 4 months ago

finger563 commented 4 months ago

Previously, the crc32 (if enabled) was being calculated on different platforms according to different byte orderings, which meant that serialized byte streams including CRC which were serialized one one system would not properly deserialize on a system with a different byte order (or for which alpaca had defined a different byte order in crc32).

This PR updates it so that no matter what, the crc32 is always computed in little endian format.