Confuser.Core/Utils.cs
/// <summary>
///     Xor the values in the two buffer together.
/// </summary>
/// <param name="buffer1">The input buffer 1.</param>
/// <param name="buffer2">The input buffer 2.</param>
/// <returns>The result buffer.</returns>
/// <exception cref="System.ArgumentException">Length of the two buffers are not equal.</exception>
Xor the values in the two buffer together.
Xor the values in the two buffer together .
public static byte[] Xor(byte[] buffer1, byte[] buffer2)
        {
            if (buffer1.Length != buffer2.Length)
                throw new ArgumentException("Length mismatched.");
            var ret = new byte[buffer1.Length];
            for (int i = 0; i < ret.Length; i++)
                ret[i] = (byte)(buffer1[i] ^ buffer2[i]);
            return ret;
        }
public static byte [ ] Xor ( byte [ ] buffer1 , byte [ ] buffer2 ) { if ( buffer1 . Length != buffer2 . Length ) throw new ArgumentException ( " " ) ; var ret = new byte [ buffer1 . Length ] ; for ( int i = 0 ; i < ret . Length ; i ++ ) ret [ i ] = ( byte ) ( buffer1 [ i ] ^ buffer2 [ i ] ) ; return ret ; }
Xor the values in the two buffer together.
Xor the values in the two buffer together .
The result buffer.
The result buffer .
Length of the two buffers are not equal.
Length of the two buffers are not equal .
buffer1
byte[]
The input buffer 1.
The input buffer 1 .
buffer2
byte[]
The input buffer 2.
The input buffer 2 .