Serializable
, Comparable<CrcAlgorithmConfig>
, org.refcodes.mixin.NameAccessor
, CrcAlgorithm
, CrcWidthAccessor
public enum CrcAlgorithmConfig extends Enum<CrcAlgorithmConfig> implements CrcAlgorithm
CrcWidthAccessor.CrcWidthBuilder<B extends CrcWidthAccessor.CrcWidthBuilder<B>>, CrcWidthAccessor.CrcWidthMutator, CrcWidthAccessor.CrcWidthProperty
Modifier and Type | Method | Description |
---|---|---|
CrcSize |
getCrcSize() |
Gets the
CrcSize class to which this CrcAlgorithm
belongs. |
int |
getCrcWidth() |
Retrieves the value from the CRC byte width (number of bytes used to
store a CRC checksum) property.
|
String |
getName() |
|
byte[] |
toCrcBytes(byte[] aData,
int aOffset,
int aLength,
Endianess aEndianess) |
Calculates the according checksum from the supplied data data and returns
the according byte array of the CRC checksum.
|
byte[] |
toCrcBytes(byte[] aData,
Endianess aEndianess) |
Calculates the according checksum from the supplied data data and returns
the according byte array of the CRC checksum.
|
byte[] |
toCrcBytes(byte aData,
Endianess aEndianess) |
Calculates the according checksum from the supplied data and returns the
according byte array of the CRC checksum.
|
byte[] |
toCrcBytes(long aCrc,
byte[] aData,
int aOffset,
int aLength,
Endianess aEndianess) |
Updates the according checksum with he supplied data data and returns the
according byte array of the CRC checksum.
|
byte[] |
toCrcBytes(long aCrc,
byte[] aData,
Endianess aEndianess) |
Updates the according checksum with he supplied data data and returns the
according byte array of the CRC checksum.
|
byte[] |
toCrcBytes(long aCrc,
byte aData,
Endianess aEndianess) |
Updates the according checksum with he supplied data data and returns the
according byte array of the CRC checksum.
|
long |
toCrcChecksum(byte aData) |
Calculates the according checksum from the supplied data.
|
long |
toCrcChecksum(byte[] aData) |
Calculates the according checksum from the supplied data.
|
long |
toCrcChecksum(byte[] aData,
int aOffset,
int aLength) |
Calculates the according checksum from the supplied data.
|
long |
toCrcChecksum(long aCrc,
byte aData) |
Updates the according checksum with he supplied data.
|
long |
toCrcChecksum(long aCrc,
byte[] aData) |
Updates the according checksum with he supplied data.
|
long |
toCrcChecksum(long aCrc,
byte[] aData,
int aOffset,
int aLength) |
Updates the according checksum with he supplied data.
|
static CrcAlgorithmConfig |
valueOf(String name) |
Returns the enum constant of this type with the specified name.
|
static CrcAlgorithmConfig[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CrcAlgorithmConfig CRC_8
public static final CrcAlgorithmConfig CRC_8_ARDUINO
public static final CrcAlgorithmConfig CRC_8_CCITT
public static final CrcAlgorithmConfig CRC_8_CDMA2000
public static final CrcAlgorithmConfig CRC_8_DARC
public static final CrcAlgorithmConfig CRC_8_DVBS2
public static final CrcAlgorithmConfig CRC_8_SAE_J1850
public static final CrcAlgorithmConfig CRC_8_EBU
public static final CrcAlgorithmConfig CRC_8_ICODE
public static final CrcAlgorithmConfig CRC_8_ITU
public static final CrcAlgorithmConfig CRC_8_MAXIM
public static final CrcAlgorithmConfig CRC_8_ROHC
public static final CrcAlgorithmConfig CRC_8_WCDMA
public static final CrcAlgorithmConfig CRC_16_CCITT_FALSE
public static final CrcAlgorithmConfig CRC_16_ARC
public static final CrcAlgorithmConfig CRC_16_AUG_CCITT
public static final CrcAlgorithmConfig CRC_16_BUYPASS
public static final CrcAlgorithmConfig CRC_16_CDMA2000
public static final CrcAlgorithmConfig CRC_16_DDS_110
public static final CrcAlgorithmConfig CRC_16_DECT_R
public static final CrcAlgorithmConfig CRC_16_DECT_X
public static final CrcAlgorithmConfig CRC_16_DNP
public static final CrcAlgorithmConfig CRC_16_EN_13757
public static final CrcAlgorithmConfig CRC_16_GENIBUS
public static final CrcAlgorithmConfig CRC_16_MAXIM
public static final CrcAlgorithmConfig CRC_16_MCRF4XX
public static final CrcAlgorithmConfig CRC_16_RIELLO
public static final CrcAlgorithmConfig CRC_16_T10_DIF
public static final CrcAlgorithmConfig CRC_16_TELEDISK
public static final CrcAlgorithmConfig CRC_16_TMS37157
public static final CrcAlgorithmConfig CRC_16_USB
public static final CrcAlgorithmConfig CRC_16_A
public static final CrcAlgorithmConfig CRC_16_KERMIT
public static final CrcAlgorithmConfig CRC_16_MODBUS
public static final CrcAlgorithmConfig CRC_16_X25
public static final CrcAlgorithmConfig CRC_16_XMODEM
public static final CrcAlgorithmConfig CRC_32
public static final CrcAlgorithmConfig CRC_32_BZIP2
public static final CrcAlgorithmConfig CRC_32_C
public static final CrcAlgorithmConfig CRC_32_D
public static final CrcAlgorithmConfig CRC_32_JAMCRC
public static final CrcAlgorithmConfig CRC_32_MPEG2
public static final CrcAlgorithmConfig CRC_32_POSIX
public static final CrcAlgorithmConfig CRC_32_Q
public static final CrcAlgorithmConfig CRC_32_XFER
public static final CrcAlgorithmConfig CRC_64
public static final CrcAlgorithmConfig CRC_64_WE
public static final CrcAlgorithmConfig CRC_64_XZ
public static CrcAlgorithmConfig[] values()
for (CrcAlgorithmConfig c : CrcAlgorithmConfig.values()) System.out.println(c);
public static CrcAlgorithmConfig valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic long toCrcChecksum(byte aData)
toCrcChecksum
in interface CrcAlgorithm
aData
- The data for which to calculate the checksum.public String getName()
getName
in interface org.refcodes.mixin.NameAccessor
public int getCrcWidth()
getCrcWidth
in interface CrcWidthAccessor
public long toCrcChecksum(long aCrc, byte aData)
toCrcChecksum
in interface CrcAlgorithm
aCrc
- The CRC checksum to be updated.aData
- The data for which to calculate the checksum.public long toCrcChecksum(byte[] aData)
toCrcChecksum
in interface CrcAlgorithm
aData
- The data for which to calculate the checksum.public long toCrcChecksum(long aCrc, byte[] aData)
toCrcChecksum
in interface CrcAlgorithm
aCrc
- The CRC checksum to be updated.aData
- The data for which to calculate the checksum.public long toCrcChecksum(byte[] aData, int aOffset, int aLength)
toCrcChecksum
in interface CrcAlgorithm
aData
- The data for which to calculate the checksum.aOffset
- The offset from where to start.aLength
- The number of bytes to cover.public long toCrcChecksum(long aCrc, byte[] aData, int aOffset, int aLength)
toCrcChecksum
in interface CrcAlgorithm
aCrc
- The CRC checksum to be updated.aData
- The data for which to calculate the checksum.aOffset
- The offset from where to start.aLength
- The number of bytes to cover.public byte[] toCrcBytes(byte aData, Endianess aEndianess)
toCrcBytes
in interface CrcAlgorithm
aData
- The data for which to calculate the checksum.aEndianess
- The Endianess
(big endian or little endian) of
the resulting bytes representing the CRC checksum.public byte[] toCrcBytes(long aCrc, byte aData, Endianess aEndianess)
toCrcBytes
in interface CrcAlgorithm
aCrc
- The CRC checksum to be updated.aData
- The data for which to calculate the checksum.aEndianess
- The Endianess
(big endian or little endian) of
the resulting bytes representing the CRC checksum.public byte[] toCrcBytes(byte[] aData, Endianess aEndianess)
toCrcBytes
in interface CrcAlgorithm
aData
- The data for which to calculate the checksum.aEndianess
- The Endianess
(big endian or little endian) of
the resulting bytes representing the CRC checksum.public byte[] toCrcBytes(long aCrc, byte[] aData, Endianess aEndianess)
toCrcBytes
in interface CrcAlgorithm
aCrc
- The CRC checksum to be updated.aData
- The data for which to calculate the checksum.aEndianess
- The Endianess
(big endian or little endian) of
the resulting bytes representing the CRC checksum.public byte[] toCrcBytes(byte[] aData, int aOffset, int aLength, Endianess aEndianess)
toCrcBytes
in interface CrcAlgorithm
aData
- The data for which to calculate the checksum.aOffset
- The offset from where to start.aLength
- The number of bytes to cover.aEndianess
- The Endianess
(big endian or little endian) of
the resulting bytes representing the CRC checksum.public byte[] toCrcBytes(long aCrc, byte[] aData, int aOffset, int aLength, Endianess aEndianess)
toCrcBytes
in interface CrcAlgorithm
aCrc
- The CRC checksum to be updated.aData
- The data for which to calculate the checksum.aOffset
- The offset from where to start.aLength
- The number of bytes to cover.aEndianess
- The Endianess
(big endian or little endian) of
the resulting bytes representing the CRC checksum.public CrcSize getCrcSize()
CrcSize
class to which this CrcAlgorithm
belongs.getCrcSize
in interface CrcAlgorithm
CrcSize
enumeration providing various width related
methods.Copyright © 2021. All rights reserved.