Java xor xor(int n1, int n2)

Here you can find the source of xor(int n1, int n2)

Description

xor

License

Open Source License

Declaration

public static int xor(int n1, int n2) 

Method Source Code

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

public class Main {
    public static int xor(int n1, int n2) {
        return n1 ^ n2;
    }//from w  w w  .  j av a  2 s .  co  m

    public static String xor(String n1, String n2) {
        if (n1.length() != n2.length())
            return null;
        StringBuilder result = new StringBuilder();
        for (int i = 0; i < n1.length(); i++) {
            int k = n1.charAt(i) ^ n2.charAt(i);
            result.append((char) k);
        }
        return result.toString();
    }
}

Related

  1. xor(final byte[] bytesA, final byte[] bytesB)
  2. xor(final byte[] hash, final byte[] input)
  3. xor(final byte[] hash, final byte[] input)
  4. xor(final byte[] input, final byte[] secret)
  5. xor(final byte[] inputByteArray, final byte timeByte)
  6. XOR(int res, String key)
  7. xor(int[] byteOne, int[] byteTwo)
  8. xor(int[] byteOne, int[] byteTwo)
  9. xor(int[][] array, int[][] array2)