Checksum: reset()
import java.util.zip.CRC32;
import java.util.zip.Checksum;
public class Main {
public static void main(String[] argv) throws Exception {
byte[] bytes = "some data".getBytes();
// Compute Adler-32 checksum
Checksum checksumEngine = new CRC32();
checksumEngine.update(bytes, 0, bytes.length);
long checksum = checksumEngine.getValue();
checksumEngine.reset();
}
}
Related examples in the same category