help converting .C function for CRC