Package org.miaixz.bus.core.io.check
Class CRC16
java.lang.Object
org.miaixz.bus.core.io.check.CRC16
- All Implemented Interfaces:
Serializable,Checksum
CRC16 循环冗余校验码(Cyclic Redundancy Check)实现,默认IBM算法
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription获取16进制的CRC16值getHexValue(boolean isPadding) 获取16进制的CRC16值longgetValue()voidreset()voidupdate(byte[] b, int off, int len) voidupdate(int b)
-
Constructor Details
-
CRC16
public CRC16() -
CRC16
构造- Parameters:
crc16Checksum-CRC16Checksum实现
-
-
Method Details
-
getHexValue
获取16进制的CRC16值- Returns:
- 16进制的CRC16值
-
getHexValue
获取16进制的CRC16值- Parameters:
isPadding- 不足4位时,是否填充0以满足位数- Returns:
- 16进制的CRC16值,4位
-
getValue
public long getValue() -
reset
public void reset() -
update
public void update(byte[] b, int off, int len) -
update
public void update(int b)
-