public final class CRCTables extends Object
This class generates tables for CRC algorithm. It is possible to change the generator polynom and the offset. Usage:
CRCTables object.generatorPolynom in the constructor.getTable with offset as an argument. The offset is an integer number,
which specifies the number of bits to shift, e.g. for A offset is 56, for
D 32.0-255) for the requested polynom.| Constructor and Description |
|---|
CRCTables(long initGeneratorPolynom)
Constructor to create a new, empty
CRCTables object with the
initialized generator polynom. |
| Modifier and Type | Method and Description |
|---|---|
protected int |
calculateCRC32(long value)
Method for CRC calculation for the just one value (type long) Algorithm:
Load the register with zero bits.
|
int[] |
getTable(int offset)
Returns all remainders of the polynomial division for the given offset.
|
public CRCTables(long initGeneratorPolynom)
CRCTables object with the
initialized generator polynom.initGeneratorPolynom - The generator polynom to use.public final int[] getTable(int offset)
offset - The numbers of bits to shift, e.g. for A offset
is 56, for D 32.protected final int calculateCRC32(long value)
value - A long value, for which the CRC should be
calculated.Copyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.