Here you can find the source of calcCRC(final byte[] data)
public static int calcCRC(final byte[] data)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from www. ja va 2s . com*/ * Calculates the CRC over all config data packets (including the last with the null bytes at the end) * (see page 49) */ public static int calcCRC(final byte[] data) { final int POLY = 0x1021; final int START_VALUE = 0xFFFF; int crc = START_VALUE; for (int i = 0; i < data.length; i++) { crc = crc ^ ((data[i] & 0xFF) << 8); for (int j = 0; j < 8; j++) { if ((crc & 0x8000) == 0x8000) { crc = crc << 1; crc = crc ^ POLY; } else { crc = crc << 1; } } } return crc & 0xFFFF; } }