Algorithm from http://en.wikipedia.org/wiki/Cyclic_redundancy_check