cerealed
cerealed copied to clipboard
Add endianness support
Cerealed seems to have no support for different byte orders. The library should clearly support both little and big endian.
Cerealed was written primarily to implement networking protocols, which are invariably big endian. Other than faster serialisation between little endian machines, what's the use case?
My particular testcase was, to read binary blocks (Type-Length-Data) out of a file and then decode the contained data into structs.
Maybe I'm biased because of my background, but I would've stored the file data in big-endian in the first place. Unless you don't control the file format?
I used the amazing lib to implement a passive DIAMETER protocol application. Two words:"Great job!"
Example use case is IoT (Internet of Things) protocols. What I'm seeing there is a shift to little-endian (or even worst, some kind of unknown mixture : https://github.com/google/eddystone/issues/138 ). I was frustrated too because I have "traditional" network background too.
P.S. "The library ~~should clearly support~~ is not bad to support both little and big endian." :+1:
I've been working on little endian but it's not trivial.