4 ms·
As a thought experiment, how do you know that bits within a byte are ordered big endian? does it have to do with the result of casting a unsigned char[4] to an
by cowtools 4y ago
As a thought experiment, how do you know that bits within a byte are ordered big endian? does it have to do with the result of casting a unsigned char[4] to an unsigned int or something? I forget.
Because if it's just that the name "left shift" corresponds to an operation that multiplies by two and vice-versa, you could probably just swap the names "left/right shift" and be none the wiser.
Edit: the point I'm making is that you need to use either a left/right shift to extract individual bits from a byte B, or calculate some AND(B, L) where L is some literal like 0x4 (in which case it depends on how you write the literal's bit order).