List of utility methods to do CRC32 Byte Array
long | crcBytes(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(); |
String | createRandomCrc32Hex() create Random Crc Hex return createCrc32Hex(createRandomString());
|
CRC32 | getCRC() thread-singleton crc engine return crcProvider.get();
|
long | getCrc32(byte[] buf) Get the standard CRC32 checksum of a byte array. CRC32 crc = new CRC32(); crc.update(buf); return crc.getValue(); |
String | getCRC32(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; |
int | getCrc32asInt(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(); |
long | getCRC32Checksum(byte[] bytes) Generate CRC32 Checksum For Byte Array. Checksum checksum = new CRC32(); checksum.update(bytes, 0, bytes.length); return checksum.getValue(); |
String | getCRC32Checksum(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(); ... |