public static String CRC_16(byte [] bytes){
int i,j,lsb;
int h=0xffff;
for(i=0;i<bytes.length;i++){
h ^= bytes[i];
for(j=0;j<8;j++) {
lsb = h & 0x0001; //取 CRC 的移出位
h >>= 1;
if (lsb == 1){
h ^= 0x8408;
}
}
}
h ^= 0xffff;
return Integer.toHexString(h).toUpperCase();
}