src/main/java/com/sauljohnson/checkers/BsdChecksumCalculator.java
public short computeShort(byte[] data) {
        int checksum = 0;
        for (byte current : data) {
            checksum = (checksum >>> 1) + ((checksum & 1) << 15);
            checksum += current;
            checksum &= 0xffff;
        }
        return (short) checksum;
    }
/**
     * Computes the checksum for the specified byte array and returns it as a 16-bit integer.
     * @param data the byte array for which to compute the checksum
     * @return  the checksum for the specified byte array as a 16-bit integer
     */
Computes the checksum for the specified byte array and returns it as a 16-bit integer.
@param data the byte array for which to compute the checksum
@return  the checksum for the specified byte array as a 16-bit integer
Computes the checksum for the specified byte array and returns it as a 16 - bit integer . @param data the byte array for which to compute the checksum @return the checksum for the specified byte array as a 16 - bit integer
public short computeShort(byte[] data) {
        int checksum = 0;
        for (byte current : data) {
            checksum = (checksum >>> 1) + ((checksum & 1) << 15);
            checksum += current;
            checksum &= 0xffff;
        }
        return (short) checksum;
    }
public short computeShort ( byte [ ] data ) { int checksum = 0 ; for ( byte current : data ) { checksum = ( checksum >>> 1 ) + ( ( checksum & 1 ) << 15 ) ; checksum += current ; checksum &= 0xffff ; } return ( short ) checksum ; }
Computes the checksum for the specified byte array and returns it as a 16-bit integer.
Computes the checksum for the specified byte array and returns it as a 16 - bit integer .