From d79754ea6c3e4021ffbef4ac7380356b9c28db5e Mon Sep 17 00:00:00 2001 From: Lewis Date: Sun, 22 Jul 2018 00:34:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DotnetSpider.Common/Md5Util.cs | 37 ------------------------- src/DotnetSpider.Common/SilentLogger.cs | 7 +++++ 2 files changed, 7 insertions(+), 37 deletions(-) delete mode 100644 src/DotnetSpider.Common/Md5Util.cs create mode 100644 src/DotnetSpider.Common/SilentLogger.cs diff --git a/src/DotnetSpider.Common/Md5Util.cs b/src/DotnetSpider.Common/Md5Util.cs deleted file mode 100644 index aa738496c..000000000 --- a/src/DotnetSpider.Common/Md5Util.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Security.Cryptography; -using System.Text; - -namespace DotnetSpider.Common -{ - public static class Md5Util - { - /// - /// 计算32位MD5 - /// - /// 需要计算的字符串 - /// 32位的MD5值 - public static string Md5Encrypt32(string str) - { -#if !NETSTANDARD20 - MD5 md5 = new MD5CryptoServiceProvider(); -#else - MD5 md5 = MD5.Create(); -#endif - byte[] fromData = Encoding.UTF8.GetBytes(str); - byte[] targetData = md5.ComputeHash(fromData); - - return BitConverter.ToString(targetData).Replace("-", "").ToLower(); - } - - /// - /// 计算8位MD5 - /// - /// 需要计算的字符串 - /// 8位的MD5值 - public static string Md5Encrypt(string str) - { - return Md5Encrypt32(str).Substring(8, 16).ToLower(); - } - } -} \ No newline at end of file diff --git a/src/DotnetSpider.Common/SilentLogger.cs b/src/DotnetSpider.Common/SilentLogger.cs new file mode 100644 index 000000000..9242b4cf5 --- /dev/null +++ b/src/DotnetSpider.Common/SilentLogger.cs @@ -0,0 +1,7 @@ +namespace DotnetSpider.Common +{ + public class SilentLogger + { + + } +} \ No newline at end of file