Package org.jacoco.core.internal.data
Class CRC64
java.lang.Object
org.jacoco.core.internal.data.CRC64
CRC64 checksum calculator based on the polynom specified in ISO 3309. The
implementation is based on the following publications:
- http://en.wikipedia.org/wiki/Cyclic_redundancy_check
- http://www.geocities.com/SiliconValley/Pines/8659/crc.htm
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long[]
private static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic long
classId
(byte[] bytes) Calculates class identifier for the given class bytes.private static long
update
(long sum, byte b) Updates given checksum by given byte.private static long
update
(long sum, byte[] bytes, int fromIndexInclusive, int toIndexExclusive) Updates given checksum by bytes from given array.
-
Field Details
-
POLY64REV
private static final long POLY64REV- See Also:
-
LOOKUPTABLE
private static final long[] LOOKUPTABLE
-
-
Constructor Details
-
CRC64
private CRC64()
-
-
Method Details
-
update
private static long update(long sum, byte b) Updates given checksum by given byte.- Parameters:
sum
- initial checksum valueb
- byte to update the checksum with- Returns:
- updated checksum value
-
update
private static long update(long sum, byte[] bytes, int fromIndexInclusive, int toIndexExclusive) Updates given checksum by bytes from given array.- Parameters:
sum
- initial checksum valuebytes
- byte array to update the checksum withfromIndexInclusive
- start index in array, inclusivetoIndexExclusive
- end index in array, exclusive- Returns:
- updated checksum value
-
classId
public static long classId(byte[] bytes) Calculates class identifier for the given class bytes.- Parameters:
bytes
- class bytes- Returns:
- class identifier
-