|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
using HtmlAgilityPack;
|
|
|
|
|
using HtmlAgilityPack;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using System.Linq;
|
|
|
|
@ -69,7 +69,7 @@ namespace Infrastructure.Extensions
|
|
|
|
|
return Enumerable.Range(0, hex.Length / 2).Select(x => Convert.ToByte(hex.Substring(x * 2, 2), 16)).ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "CA5351:不要使用损坏的加密算法", Justification = "<挂起>")]
|
|
|
|
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "CA5351:不要使用损坏的加密算法", Justification = "<挂起>")]
|
|
|
|
|
public static string DESEncrypt(this string value, string key)
|
|
|
|
|
{
|
|
|
|
|
using var des = new DESCryptoServiceProvider();
|
|
|
|
@ -89,7 +89,7 @@ namespace Infrastructure.Extensions
|
|
|
|
|
return ret.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "CA5351:不要使用损坏的加密算法", Justification = "<挂起>")]
|
|
|
|
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "CA5351:不要使用损坏的加密算法", Justification = "<挂起>")]
|
|
|
|
|
public static string DESDecrypt(this string value, string key)
|
|
|
|
|
{
|
|
|
|
|
if (value is null)
|
|
|
|
@ -116,9 +116,9 @@ namespace Infrastructure.Extensions
|
|
|
|
|
|
|
|
|
|
public static Guid ToGuid(this string input)
|
|
|
|
|
{
|
|
|
|
|
#pragma warning disable CA5351 // 不要使用损坏的加密算法
|
|
|
|
|
#pragma warning disable CA5351 // 不要使用损坏的加密算法
|
|
|
|
|
using MD5 md5 = MD5.Create();
|
|
|
|
|
#pragma warning restore CA5351 // 不要使用损坏的加密算法
|
|
|
|
|
#pragma warning restore CA5351 // 不要使用损坏的加密算法
|
|
|
|
|
var hash = md5.ComputeHash(Encoding.UTF8.GetBytes(input));
|
|
|
|
|
var guid = new Guid(hash);
|
|
|
|
|
//list.Add(input, guid.ToString());
|
|
|
|
|