Calculate checksums for a range of bytes.
import java.util.zip.Adler32;
import java.util.zip.Checksum;
public class Main {
public static long compute(byte[] data, int start, int length) {
Checksum checksum = new Adler32();
checksum.update(data, start, length);
return checksum.getValue();
}
}
Home
Java Book
Runnable examples
Java Book
Runnable examples
Security:
- Calculate checksums for a range of bytes.
- Calculate MD5 for a String
- Calculate MD5 for a Stream