2 ms·
> It's extremely important to your mental model to understand how the bits are arranged And the shortcut for that is simply regard bytes as big-endian. On all
by kazinator 9y ago
> It's extremely important to your mental model to understand how the bits are arranged
And the shortcut for that is simply regard bytes as big-endian. On all platforms. Whether you're on a PPC or x86, the byte 0x80 is going to go out on the wire as 1 first, followed by 7 zeros.
So if you're writing a data compressor and the spec says that the variable-length bit strings (huffman or whatever) are stuffed into bytes in network order, that means you fill bytes from the left down. That is done with code that works the same way on BE or LE platforms.