Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

definitive CRC for C

Tags:

Since CRC is so widely used, I'm surprised by having a hard time finding CRC implementations in C.

Is there a "definitive" CRC calculation snippet/algorithm for C, that "everyone" uses? Or: is there a good CRC implementation somebody can vouch for, and point me towards? I'm looking for CRC8 and CRC16 implementations in particular.

Come to think of it, my situation may be a little unconventional. I'm writing C code for Linux, and the code should eventually be ported to a microcontroller. It seems some microcontroller APIs do come with CRC implementations; in any case, I'm looking for a generic software implementation (I read that CRC is originally meant to be hardware implemented).