Java xor xor(byte[] x, byte[] y)

Here you can find the source of xor(byte[] x, byte[] y)

Description

xor

License

Open Source License

Declaration

static void xor(byte[] x, byte[] y) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    static void xor(byte[] x, byte[] y) {
        int i = 0;
        do {//from w w  w .j ava 2s. com
            x[i] ^= y[i];
            ++i;
            x[i] ^= y[i];
            ++i;
            x[i] ^= y[i];
            ++i;
            x[i] ^= y[i];
            ++i;
        } while (i < 16);
    }

    static void xor(byte[] x, byte[] y, int yOff, int yLen) {
        while (yLen-- > 0) {
            x[yLen] ^= y[yOff + yLen];
        }
    }

    static void xor(byte[] x, byte[] y, byte[] z) {
        int i = 0;
        do {
            z[i] = (byte) (x[i] ^ y[i]);
            ++i;
            z[i] = (byte) (x[i] ^ y[i]);
            ++i;
            z[i] = (byte) (x[i] ^ y[i]);
            ++i;
            z[i] = (byte) (x[i] ^ y[i]);
            ++i;
        } while (i < 16);
    }

    static void xor(int[] x, int[] y) {
        x[0] ^= y[0];
        x[1] ^= y[1];
        x[2] ^= y[2];
        x[3] ^= y[3];
    }

    static void xor(int[] x, int[] y, int[] z) {
        z[0] = x[0] ^ y[0];
        z[1] = x[1] ^ y[1];
        z[2] = x[2] ^ y[2];
        z[3] = x[3] ^ y[3];
    }

    static void xor(long[] x, long[] y) {
        x[0] ^= y[0];
        x[1] ^= y[1];
    }

    static void xor(long[] x, long[] y, long[] z) {
        z[0] = x[0] ^ y[0];
        z[1] = x[1] ^ y[1];
    }
}

Related

  1. xor(byte[] data, byte[] xork)
  2. xor(byte[] first, byte[] second)
  3. xor(byte[] firstBytes, int firstOffset, byte[] secondBytes, int secondOffset, byte[] outBytes, int outOffset, int size)
  4. xor(byte[] op1, byte[] op2)
  5. xor(byte[] source, byte[] key)
  6. xor(byte[]... bytesArr)
  7. xor(char[] a, char[] b)
  8. xor(double lhs, double rhs)
  9. xor(final boolean value1, final boolean value2)