Here you can find the source of xor(byte[] a, byte[] b)
Parameter | Description |
---|---|
a | a parameter |
b | a parameter |
public static byte[] xor(byte[] a, byte[] b)
//package com.java2s; //License from project: Open Source License public class Main { /**/*www . j a va2s . c o m*/ * bytewise xor of two arrays * @param a * @param b * @return */ public static byte[] xor(byte[] a, byte[] b) { byte[] c = new byte[Math.min(a.length, b.length)]; for (int i = 0; i < c.length; i++) { c[i] = (byte) (a[i] ^ b[i]); } return c; } }