Is there any difference between the Java CRC32 implementations on 32Bit and 64Bit JVMs? My problem is, that my client application (on a 32Bit platform) calculates a hash and compares it against a hash开发者_Python百科 that was calculated by a 64Bit server application. Sometimes (not always) I get different results.
Does anyone know what the problem could be?
Thanks in advance!
You mean CRC32 class?
No, CRC-32 is a fixed algorithm and both JVM version and CPU type shouldn't have any affect on it. In fact, CRC-32 is used for instance in Ethernet which is architecture agnostic.
If you know the data that manifests mismatched CRC-32, check it against some arbitrary CRC calculator, like this one. Clearly either server- or client-side is doing the computation wrong.
My guess is that on some side not the whole stream/file is processed (few bytes at the end of file presumably).
精彩评论