Java examples for Security:CRC
Calculates a CRC-32 checksum for the given bytes.
//package com.java2s; import java.util.zip.CRC32; public class Main { /**/* w ww . ja v a 2 s. c o m*/ * Calculates a CRC-32 checksum for the given bytes. * * @param bytes * the bytes. * @return a checksum. */ public static long calculateChecksum(byte[] bytes) { CRC32 crc = new CRC32(); crc.update(bytes); return crc.getValue(); } }