摘要: 直接上代码: 1 using System; 2 3 4 class ToolUtils 5 { 6 /// <summary> 7 /// 余式表定义 8 /// </summary> 9 static ushort[] crc16tab = new ushort[256] { 10 0x0000 阅读全文
posted @ 2022-02-11 20:08 小·糊涂仙 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 今天偶然发现一个问题——字符串字节获取的方式不同会导致获取的结果不一样。 定义如下方法,用于获取字符串的字节: 1 static byte[] GetBytes(string data) 2 { 3 using (MemoryStream ms = new MemoryStream()) 4 { 5 阅读全文
posted @ 2022-02-11 19:50 小·糊涂仙 阅读(1200) 评论(0) 推荐(0) 编辑
摘要: 加密解密的核心代码: 1 using System; 2 using System.IO; 3 using System.Security.Cryptography; 4 using System.Text; 5 6 public class AESChiper 7 { 8 /// <summary 阅读全文
posted @ 2022-02-11 15:14 小·糊涂仙 阅读(182) 评论(0) 推荐(0) 编辑