Package com.scurrilous.circe.checksum
Class Crc32cIntChecksum
- java.lang.Object
-
- com.scurrilous.circe.checksum.Crc32cIntChecksum
-
public class Crc32cIntChecksum extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Crc32cIntChecksum()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
acceptsMemoryAddressBuffer()
static int
computeChecksum(io.netty.buffer.ByteBuf payload)
Computes crc32c checksum: if it is able to load crc32c native library then it computes using that native library which is faster as it computes using hardware machine instruction else it computes using crc32c algo.static int
computeChecksum(io.netty.buffer.ByteBuf payload, int offset, int len)
Computes crc32c checksum: if it is able to load crc32c native library then it computes using that native library which is faster as it computes using hardware machine instruction else it computes using crc32c algo.static int
resumeChecksum(int previousChecksum, byte[] payload, int offset, int len)
Computes incremental checksum with input previousChecksum and input payloadstatic int
resumeChecksum(int previousChecksum, io.netty.buffer.ByteBuf payload)
Computes incremental checksum with input previousChecksum and input payloadstatic int
resumeChecksum(int previousChecksum, io.netty.buffer.ByteBuf payload, int offset, int len)
Computes incremental checksum with input previousChecksum and input payload
-
-
-
Method Detail
-
computeChecksum
public static int computeChecksum(io.netty.buffer.ByteBuf payload)
Computes crc32c checksum: if it is able to load crc32c native library then it computes using that native library which is faster as it computes using hardware machine instruction else it computes using crc32c algo.- Parameters:
payload
-- Returns:
-
computeChecksum
public static int computeChecksum(io.netty.buffer.ByteBuf payload, int offset, int len)
Computes crc32c checksum: if it is able to load crc32c native library then it computes using that native library which is faster as it computes using hardware machine instruction else it computes using crc32c algo.- Parameters:
payload
-- Returns:
-
resumeChecksum
public static int resumeChecksum(int previousChecksum, io.netty.buffer.ByteBuf payload)
Computes incremental checksum with input previousChecksum and input payload- Parameters:
previousChecksum
- : previously computed checksumpayload
-- Returns:
-
resumeChecksum
public static int resumeChecksum(int previousChecksum, io.netty.buffer.ByteBuf payload, int offset, int len)
Computes incremental checksum with input previousChecksum and input payload- Parameters:
previousChecksum
- the previously computed checksumpayload
- the data for which the checksum is to be computedoffset
- the starting position in the payloadlen
- the number of bytes to include in the checksum computation- Returns:
- the updated checksum
-
resumeChecksum
public static int resumeChecksum(int previousChecksum, byte[] payload, int offset, int len)
Computes incremental checksum with input previousChecksum and input payload- Parameters:
previousChecksum
- the previously computed checksumpayload
- the data for which the checksum is to be computedoffset
- the starting position in the payloadlen
- the number of bytes to include in the checksum computation- Returns:
- the updated checksum
-
acceptsMemoryAddressBuffer
public static boolean acceptsMemoryAddressBuffer()
-
-