类 CRCs

java.lang.Object
net.apexes.commons.lang.CRCs

public final class CRCs extends Object
作者:
HeDYn
  • 方法概要

    修饰符和类型
    方法
    说明
    static int
    crc16(byte[] bytes)
    计算CRC16校验
    static int
    crc16(byte[] bytes, int offset, int len)
    计算CRC16校验
    static int
    crc16(byte[] bytes, int offset, int len, int preval)
    计算CRC16校验
    static byte
    crc8(byte[] bytes)
    计算数组的CRC8校验值
    static byte
    crc8(byte[] bytes, int offset, int len)
    计算CRC8校验值
    static byte
    crc8(byte[] bytes, int offset, int len, byte preval)
    计算CRC8校验值

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 方法详细资料

    • 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校验值