modules/hk-lucene-builder/src/main/java/org/hawkore/ignite/lucene/util/FBUtilities.java
/**
     * @return The bitwise XOR of the inputs. The output will be the same length as the
     * longer input, but if either input is null, the output will be null.
     */
@return The bitwise XOR of the inputs. The output will be the same length as the
longer input, but if either input is null, the output will be null.
@return The bitwise XOR of the inputs . The output will be the same length as the longer input but if either input is null the output will be null .
public static byte[] xor(byte[] left, byte[] right)
    {
        if (left == null || right == null)
            return null;
        if (left.length > right.length)
        {
            byte[] swap = left;
            left = right;
            right = swap;
        }
        byte[] out = Arrays.copyOf(right, right.length);
        for (int i = 0; i < left.length; i++)
        {
            out[i] = (byte)((left[i] & 0xFF) ^ (right[i] & 0xFF));
        }
        return out;
    }
public static byte [ ] xor ( byte [ ] left , byte [ ] right ) { if ( left == null || right == null ) return null ; if ( left . length > right . length ) { byte [ ] swap = left ; left = right ; right = swap ; } byte [ ] out = Arrays . copyOf ( right , right . length ) ; for ( int i = 0 ; i < left . length ; i ++ ) { out [ i ] = ( byte ) ( ( left [ i ] & 0xFF ) ^ ( right [ i ] & 0xFF ) ) ; } return out ; }
@return The bitwise XOR of the inputs.
@return The bitwise XOR of the inputs .
// left.length is now <= right.length