static public short getCRC(byte[] buf, int len)
	{
		short i;
		short crc = 0x7fff;
		boolean isNeg = true;

		for(int j = 0; j < len; j++) {
			crc ^= buf[j] & 0xff;

			for (i = 0; i < 8; i++) {
				if ((crc & 1) == 0) {
					crc >>= 1;
					if (isNeg) {
						isNeg = false;
						crc |= 0x4000;
					}
				} else {
					crc >>= 1;
					if (isNeg) {
						crc ^= 0x4408;
					} else {
						crc ^= 0x0408;
						isNeg = true;
					}
				}
			}
		}

		return isNeg ? (short) (crc | (short) 0x8000) : crc;
	}