N
Wenn dir ein 256-teiliger Lookup Table zu sperrig ist, könntest du es auch so machen:
static const unsigned char lookup[16] = {
0x00, 0x20, 0x10, 0x30, 0x08, 0x28, 0x18, 0x38,
0x04, 0x24, 0x14, 0x34, 0x0c, 0x2c, 0x1c, 0x3c };
unsigned char newbyte = (byte & 0xc3) | lookup[(byte & 0x3c) >> 2];