Question

The work I'm doing requires us to store CRC16 checksums along with rows of data, and recently I've discovered that the performance of sun.misc.CRC16 is one of the primary bottlenecks in the code that we're running.

I've found out from searching that implementing CRC16 with a lookup table will give me the performance gains I'm looking for, but also that there are many different standards. Since it will likely take some time to try to get any kind of answer about what the users actually want, in the meantime I want to replace sun.misc.CRC16 with its lookup-table-functional-equivalent. However, the only real documentation/source I am able to find on the class itself doesn't really elaborate--or at least, my understanding of CRC isn't good enough yet.

Was it helpful?

Solution

Well, it uses an initial value of zero, a polynomial of 0x1021, and doesn't do a final XOR.

I must say I'm shocked to find it doesn't use a table. The technique has been around since the mid-1980s.

Of course you shouldn't be using a sun.misc.* class at all in the first place.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top