code: 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;
  	}
docs: <p>Method for calculating a CRC13239 checksum over a byte buffer.</p>
  @param buf byte buffer to be checksummed.
  @param len how much of the buffer should be checksummed
  @return CRC13239 checksum