diff options
| author | Bond-009 <bond.009@outlook.com> | 2019-03-25 22:25:32 +0100 |
|---|---|---|
| committer | Bond-009 <bond.009@outlook.com> | 2019-03-25 22:25:32 +0100 |
| commit | b44a70ff368f228fc27a184e2139d288bada85cc (patch) | |
| tree | 3612f517f0666761bc3f5765217e8fa4d8f64663 /MediaBrowser.Common/Extensions/BaseExtensions.cs | |
| parent | 5024c52c60617fffc09ee7b6eeabe0ac400bae75 (diff) | |
Simplify/remove/clean code
* Remove useless runtime check (we only support one)
* Remove unused args
* Remove a global constant
And ofc fix some warnings ;)
Diffstat (limited to 'MediaBrowser.Common/Extensions/BaseExtensions.cs')
| -rw-r--r-- | MediaBrowser.Common/Extensions/BaseExtensions.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/MediaBrowser.Common/Extensions/BaseExtensions.cs b/MediaBrowser.Common/Extensions/BaseExtensions.cs index db0514bb1..40c16b957 100644 --- a/MediaBrowser.Common/Extensions/BaseExtensions.cs +++ b/MediaBrowser.Common/Extensions/BaseExtensions.cs @@ -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))); + } } } } |
