Java Utililty Methods CRC32 Byte Array

List of utility methods to do CRC32 Byte Array

Description

The list of methods to do CRC32 Byte Array are organized into topic(s).

Method

longcrcBytes(byte[]... data)
calculates the crc32 of all byte arrays
CRC32 crc = new CRC32();
for (int i = 0; i < data.length; i++) {
    crc.update(data[i]);
return crc.getValue();
StringcreateRandomCrc32Hex()
create Random Crc Hex
return createCrc32Hex(createRandomString());
CRC32getCRC()
thread-singleton crc engine
return crcProvider.get();
longgetCrc32(byte[] buf)
Get the standard CRC32 checksum of a byte array.
CRC32 crc = new CRC32();
crc.update(buf);
return crc.getValue();
StringgetCRC32(String str)
get CRC
java.util.zip.CRC32 crc32 = new java.util.zip.CRC32();
crc32.update(str.getBytes());
String retcrc32 = Long.toHexString(crc32.getValue());
return retcrc32;
intgetCrc32asInt(byte[] in)
Use this method to calculate the CRC32 signature of a byte array.
if (in == null || in.length == 0)
    return -1;
CRC32 crc = new CRC32();
crc.update(in);
return (int) crc.getValue();
longgetCRC32Checksum(byte[] bytes)
Generate CRC32 Checksum For Byte Array.
Checksum checksum = new CRC32();
checksum.update(bytes, 0, bytes.length);
return checksum.getValue();
StringgetCRC32Checksum(String pString)
get CRC Checksum
long decimalChecksum = 0;
String hexChecksum = null;
final String ZEROS = "00000000";
final int CRC32_CHECKSUM_LENGTH = 8;
CRC32 checksumEngine = new CRC32();
checksumEngine.update(pString.getBytes());
decimalChecksum = checksumEngine.getValue();
hexChecksum = Long.toHexString(decimalChecksum).toUpperCase();
...