类 CRCs
java.lang.Object
net.apexes.commons.lang.CRCs
- 作者:
- HeDYn
-
方法概要
修饰符和类型方法说明static intcrc16(byte[] bytes) 计算CRC16校验static intcrc16(byte[] bytes, int offset, int len) 计算CRC16校验static intcrc16(byte[] bytes, int offset, int len, int preval) 计算CRC16校验static bytecrc8(byte[] bytes) 计算数组的CRC8校验值static bytecrc8(byte[] bytes, int offset, int len) 计算CRC8校验值static bytecrc8(byte[] bytes, int offset, int len, byte preval) 计算CRC8校验值
-
方法详细资料
-
crc8
public static byte crc8(byte[] bytes) 计算数组的CRC8校验值- 参数:
bytes- 需要计算的数组- 返回:
- CRC8校验值
-
crc8
public static byte crc8(byte[] bytes, int offset, int len) 计算CRC8校验值- 参数:
bytes- 数据offset- 起始位置len- 长度- 返回:
- 校验值
-
crc8
public static byte crc8(byte[] bytes, int offset, int len, byte preval) 计算CRC8校验值- 参数:
bytes- 数据offset- 起始位置len- 长度preval- 之前的校验值- 返回:
- 校验值
-
crc16
public static int crc16(byte[] bytes) 计算CRC16校验- 参数:
bytes- 需要计算的数组- 返回:
- CRC16校验值
-
crc16
public static int crc16(byte[] bytes, int offset, int len) 计算CRC16校验- 参数:
bytes- 需要计算的数组offset- 起始位置len- 长度- 返回:
- CRC16校验值
-
crc16
public static int crc16(byte[] bytes, int offset, int len, int preval) 计算CRC16校验- 参数:
bytes- 需要计算的数组offset- 起始位置len- 长度preval- 之前的校验值- 返回:
- CRC16校验值
-