public final class CrcCombineChecksumUtil extends Object
The implementation of CRC combination was taken from the zlib source code here: https://github.com/luvit/zlib/blob/master/crc32.c
| Modifier and Type | Field and Description |
|---|---|
static int |
CRC_SIZE |
| Modifier and Type | Method and Description |
|---|---|
static long |
combine(long crc1,
long crc2,
long originalLengthOfCrc2,
long[][] combineMatrices)
Combines two CRC values into a single CRC using the specified combine matrices.
|
static long[][] |
generateCombineMatrices(long polynomial)
Generates the combine matrices for CRC calculations.
|
public static final int CRC_SIZE
public static long[][] generateCombineMatrices(long polynomial)
polynomial - The CRC polynomial.public static long combine(long crc1,
long crc2,
long originalLengthOfCrc2,
long[][] combineMatrices)
THIS COMBINE FUNCTION HAS BEEN MODIFIED FROM THE ORIGINAL VERSION. The code comes from https://github.com/luvit/zlib/blob/master/crc32.c.
crc1 - The first CRC value.crc2 - The second CRC value.originalLengthOfCrc2 - The length of the original data for the second CRC.
This represents the length of data used to compute crc2.combineMatrices - The combine matrices used for combining CRCs.
These matrices are precomputed to facilitate efficient combination.IllegalArgumentException - if originalLengthOfCrc2 is negative.Copyright © 2026. All rights reserved.