Class CRC64

java.lang.Object
org.jacoco.core.internal.data.CRC64

public final class CRC64 extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    private static final long[]
     
    private static final long
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 value
      b - 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 value
      bytes - byte array to update the checksum with
      fromIndexInclusive - start index in array, inclusive
      toIndexExclusive - 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