您的位置:首页 > 其它

异或

2014-01-04 19:49 148 查看
byte[] arr1 = { 0x06, 0x12, 0x34, 0x56, 0xFF, 0xFF, 0xFF, 0xFF };
byte[] arr2 = { 0x00, 0x00, 0x67, 0x89, 0x01, 0x23, 0x45, 0x67 };
byte[] arrXor = new byte[arr1.Length];

for (int i = 0; i < arr1.Length; i++)
{
arrXor[i] = (byte)(arr1[i] ^ arr2[i]);
Console.WriteLine("0x{0:x}", arrXor[i]);
}
for (int i = 0; i < arr1.Length; i++)
{
arrXor[i] = (byte)(arrXor[i] ^ arr2[i]);
//   Console.WriteLine("0x{0:x}", arrXor[i]);
Console.WriteLine("{0}", arrXor[i]);
}


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: