异或
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]); }
相关文章推荐
- 字段初始值设定项无法引用非静态字段、方法或属性
- 45个实用的JavaScript技巧、窍门和最佳实践
- objloader使用方法
- objloader使用方法
- 算法与数据结构之一------顺序表
- 45个实用的JavaScript技巧、窍门和最佳实践
- Java中的switch语句
- c#带参数和返回值的函数 开启线程调用的方法
- android ProgressDialog 模态
- onpaste事件的浅谈
- lvm磁盘管理
- 四十 创建rtp头 注意位的存储方式
- java多线程之类锁
- 二叉查找树
- linux在线安装mysql数据库及简单配置
- 微软BI 之SSAS 系列 - 多维数据集维度用法之二 事实维度(退化维度 Degenerate Dimension)
- linux在线安装mysql数据库及简单配置
- IOS开发入门之设计模式
- Entity FrameWork 中使用Lambda访问数据库性能优化
- PXE无人值守安装