Does anyone have a slick CRC7 routine that is small, quick, and doesnt use a lookup table. Something along the lines of this CRC16 routine:

unsigned int CRC16(unsigned char *data, unsigned int length) { unsigned int crc = 0; while(length--) { crc = (unsigned char)(crc >> 8) | (crc << 8); crc ^= *data++; crc ^= (unsigned char)(crc & 0xff) >> 4; crc ^= (crc << 8) << 4; crc ^= ((crc & 0xff) << 4) << 1; } return(crc); }

I started to dig into the workings so I could use the same theory for CRC7, but thought it best not to reinvent the wheel if its out there already (the real reaon: I feel like I am in number theory again and my brain is melting). Maybe someone would share if they had it? I have 2 version that work but, one is a solution that has a lot of branching and one is a lookup. Simple, elegant, clean, you have to respect that (even if you dont understand it).

Thanks,

Vern