Package x3
Class CRC16
java.lang.Object
x3.CRC16
public class CRC16
extends java.lang.Object
Copied from Mark Johnson's CRC16v3 but adapted to
work with a byte array rather than short input.
- Author:
- Doug Gillespie
-
Constructor Summary
Constructors Constructor Description CRC16()
-
Method Summary
-
Constructor Details
-
CRC16
public CRC16()
-
-
Method Details
-
getCRC16
public static short getCRC16(byte[] byteBuffer, int nBytes, int offsetBytes)Generate a 16 bit crc code from byte data.- Parameters:
byteBuffer
- buffer of byte datanBytes
- number of bytes to processoffsetBytes
- offset from start of byte buffer (in bytes).- Returns:
- crc16 code.
-
getCRC16
public static short getCRC16(byte[] byteBuffer, int nBytes)Generate a 16 bit crc code from byte data.- Parameters:
byteBuffer
- buffer of byte datanBytes
- number of bytes to processoffsetBytes
- offset from start of byte buffer (in bytes).- Returns:
- crc16 code.
-