Java Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | import java.util.zip.Adler32; import java.util.zip.Checksum; public class JavaAdler32CheckSum { public static void main(String args[]) { String string = "Adler32 Checksum For Byte Array"; // Convert string to bytes byte bytes[] = string.getBytes(); Checksum checksum = new Adler32(); checksum.update(bytes, 0, bytes.length); long lngChecksum = checksum.getValue(); System.out.println("Adler32 checksum for byte array :" + lngChecksum); } } |
Adler32 Checksum, Java