add crc

A simple CRC implementation.