Class Crc32c

java.lang.Object
org.agrona.checksum.Crc32c
All Implemented Interfaces:
Checksum

public final class Crc32c extends Object implements Checksum
Implementation of the Checksum interface that computes CRC-32C checksum.

CRC-32C is defined in RFC 3720: Internet Small Computer Systems Interface (iSCSI).

  • Field Details

    • INSTANCE

      public static final Crc32c INSTANCE
      Single instance to compute CRC-32C checksum.
    • UPDATE_DIRECT_BYTE_BUFFER

      private static final MethodHandle UPDATE_DIRECT_BYTE_BUFFER
  • Constructor Details

    • Crc32c

      private Crc32c()
  • Method Details

    • bitwiseComplement

      private static int bitwiseComplement(int value)
    • compute

      public int compute(long address, int offset, int length)
      Computes a checksum based on the contents of a java.nio.DirectByteBuffer.
      Specified by:
      compute in interface Checksum
      Parameters:
      address - of the buffer.
      offset - within the buffer to begin at.
      length - of the data to read.
      Returns:
      computed checksum value.