CrcUtil.java
373 Bytes
package com.bsth.util;
/**
* @author Hill
*/
public class CrcUtil {
public static byte bbc(byte[] bytes, int start, int end) {
if (start > end) {
throw new IllegalArgumentException("无效的参数");
}
byte crc = 0;
for (int i = start;i <= end;i++) {
crc ^= bytes[i];
}
return crc;
}
}