Xor two byte array - CSharp System

CSharp examples for System:Byte Array

Description

Xor two byte array

Demo Code


using System.Linq;

public class Main{
        public static byte[] Xor(byte[] left, byte[] right)
        {/*from   w  w w.  ja v  a 2 s . c  o m*/
            byte[] val = new byte[left.Length];
            for (int i = 0; i < left.Length; i++)
                val[i] = (byte)(left[i] ^ right[i]);
            return val;
        }
}

Related Tutorials