Simplify/remove/clean code

* Remove useless runtime check (we only support one)
* Remove unused args
* Remove a global constant

And ofc fix some warnings ;)
This commit is contained in:
Bond-009
2019-03-25 22:25:32 +01:00
parent 5024c52c60
commit b44a70ff36
14 changed files with 50 additions and 73 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Text;
using System.Text.RegularExpressions;
using MediaBrowser.Model.Cryptography;
using System.Security.Cryptography;
namespace MediaBrowser.Common.Extensions
{
@@ -9,8 +10,6 @@ namespace MediaBrowser.Common.Extensions
/// </summary>
public static class BaseExtensions
{
public static ICryptoProvider CryptographyProvider { get; set; }
/// <summary>
/// Strips the HTML.
/// </summary>
@@ -31,7 +30,10 @@ namespace MediaBrowser.Common.Extensions
/// <returns>Guid.</returns>
public static Guid GetMD5(this string str)
{
return CryptographyProvider.GetMD5(str);
using (var provider = MD5.Create())
{
return new Guid(provider.ComputeHash(Encoding.Unicode.GetBytes(str)));
}
}
}
}