Java CRC32 Byte Array getCRC32Checksum(byte[] bytes)

Here you can find the source of getCRC32Checksum(byte[] bytes)

Description

Generate CRC32 Checksum For Byte Array.

License

Apache License

Parameter

Parameter Description
bytes byte array

Return

checksum CRC32 checksum value

Declaration

public static long getCRC32Checksum(byte[] bytes) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.zip.CRC32;
import java.util.zip.Checksum;

public class Main {
    /**/*from  w  w  w . ja  v  a 2 s  .c  om*/
     * Generate CRC32 Checksum For Byte Array.
     *
     * @param bytes byte array
     * @return checksum CRC32 checksum value
     * @since 3.3
     */
    public static long getCRC32Checksum(byte[] bytes) {
        Checksum checksum = new CRC32();
        checksum.update(bytes, 0, bytes.length);
        return checksum.getValue();
    }
}

Related

  1. createRandomCrc32Hex()
  2. getCRC()
  3. getCrc32(byte[] buf)
  4. getCRC32(String str)
  5. getCrc32asInt(byte[] in)
  6. getCRC32Checksum(String pString)