I need to compare files with java with the CRC32 code provided by C # script. When I calculate CRC32 with java.util.zip.CRC32, the result is completely different ...
I assume that polynomial = 0x2033 C # script does not match the one used in zip.CRC32. Is it possible to set a polynomial? Or any java class ideas for calculating CRC32 where you can define your own polynomial?
UPDATE: The problem is not polynomial. The same thing happens between C # and Java
This is my code, maybe something is wrong with the way I read the file?
package com.mine.digits.internal.contentupdater; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.zip.CRC32; public class CRC { public static String doConvert32(File file) { byte[] bytes = readBytesFromFile(file);
Thanks a lot Frank
source share