2021年6月22日

摘要: /// <summary> /// 字节数组转换为Hex字符串 /// </summary> /// <param name="data"></param> /// <param name="toLowerCase"></param> /// <returns></returns> private 阅读全文
posted @ 2021-06-22 15:26 炼金师 阅读(856) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// hmacsha256加密 /// </summary> /// <param name="message">内容</param> /// <param name="secret">密钥</param> /// <param name="encoding">你懂的< 阅读全文
posted @ 2021-06-22 15:23 炼金师 阅读(1055) 评论(0) 推荐(0) 编辑

2021年5月4日

摘要: using System; using System.Collections.Generic; using System.IO; using System.Text; /// <summary> /// 打印error类 /// </summary> public class LogUtil { p 阅读全文
posted @ 2021-05-04 12:12 炼金师 阅读(365) 评论(0) 推荐(0) 编辑

2021年4月16日

摘要: 1.从证书提取私钥、公钥 假如证书名字为"ttt.pfx" 私钥提取:pkcs12 -in 文件名.pfx -nocerts -nodes 如果有密码,就会提示输入密码(注意密码输入是看不到的) 公钥提取:x509 -in 文件名.cer -pubkey -noout 2.用openssl生成rsa 阅读全文
posted @ 2021-04-16 13:16 炼金师 阅读(710) 评论(0) 推荐(0) 编辑

2021年2月5日

摘要: using System; using System.IO; using System.Net; using System.Net.Security; using System.Security.Cryptography.X509Certificates; using System.Text; us 阅读全文
posted @ 2021-02-05 10:35 炼金师 阅读(1006) 评论(0) 推荐(0) 编辑

2021年1月18日

摘要: 注意,仅适用于某一系统内,思路是用ascill码去累加,累加到一定次数重置,使用时需配合datetime去拼接,这样可以达到理论上就算在同一时间内同时触发,也能保证生成的码不重复。 下面直接贴代码。 using System; using System.IO; /// <summary> /// 生 阅读全文
posted @ 2021-01-18 15:48 炼金师 阅读(84) 评论(0) 推荐(0) 编辑

2020年12月11日

摘要: /// <summary> /// Escape方法 /// </summary> /// <param name="s"></param> /// <returns></returns> public static string Escape(string s) { StringBuilder s 阅读全文
posted @ 2020-12-11 16:07 炼金师 阅读(120) 评论(0) 推荐(0) 编辑
摘要: string test = "小飞侠"; test = HttpUtility.UrlEncode(test, Encoding.UTF8);//编码 test = HttpUtility.UrlDecode(test, Encoding.UTF8);//解码 阅读全文
posted @ 2020-12-11 15:28 炼金师 阅读(244) 评论(0) 推荐(0) 编辑

2020年12月2日

摘要: web.config中的“system.webServer”标签页中添加 <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin" value="*" /> <add name="Access-Control-All 阅读全文
posted @ 2020-12-02 16:54 炼金师 阅读(91) 评论(0) 推荐(0) 编辑

2020年11月19日

摘要: using System; public class Crc { /// <summary> /// 判断数据中crc是否正确 /// </summary> /// <param name="datas">传入的数据后两位是crc</param> /// <returns></returns> pu 阅读全文
posted @ 2020-11-19 17:31 炼金师 阅读(508) 评论(0) 推荐(0) 编辑

导航