diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-10-23 15:14:57 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-10-23 15:14:57 -0400 |
| commit | 07791d46a571d3d6eed23e98ec0fe1c46ea0d37f (patch) | |
| tree | dc34a04c700f8837c557c511edab20ce9816d82d /MediaBrowser.Common/Extensions | |
| parent | 48296834028bdfaf782132258d87fdab42f528eb (diff) | |
rework scheduled tasks in preparation of common project going portable
Diffstat (limited to 'MediaBrowser.Common/Extensions')
| -rw-r--r-- | MediaBrowser.Common/Extensions/BaseExtensions.cs | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/MediaBrowser.Common/Extensions/BaseExtensions.cs b/MediaBrowser.Common/Extensions/BaseExtensions.cs index 22dfa378f..09f6e8706 100644 --- a/MediaBrowser.Common/Extensions/BaseExtensions.cs +++ b/MediaBrowser.Common/Extensions/BaseExtensions.cs @@ -1,9 +1,7 @@ using System; using System.Globalization; -using System.Linq; -using System.Security.Cryptography; -using System.Text; using System.Text.RegularExpressions; +using MediaBrowser.Model.Cryptography; namespace MediaBrowser.Common.Extensions { @@ -12,6 +10,7 @@ namespace MediaBrowser.Common.Extensions /// </summary> public static class BaseExtensions { + public static ICryptographyProvider CryptographyProvider { get; set; } /// <summary> /// Strips the HTML. @@ -26,15 +25,6 @@ namespace MediaBrowser.Common.Extensions return Regex.Replace(htmlString, pattern, string.Empty).Trim(); } - public static string RemoveDiacritics(this string text) - { - return String.Concat( - text.Normalize(NormalizationForm.FormD) - .Where(ch => CharUnicodeInfo.GetUnicodeCategory(ch) != - UnicodeCategory.NonSpacingMark) - ).Normalize(NormalizationForm.FormC); - } - /// <summary> /// Gets the M d5. /// </summary> @@ -42,10 +32,7 @@ namespace MediaBrowser.Common.Extensions /// <returns>Guid.</returns> public static Guid GetMD5(this string str) { - using (var provider = MD5.Create()) - { - return new Guid(provider.ComputeHash(Encoding.Unicode.GetBytes(str))); - } + return CryptographyProvider.GetMD5(str); } /// <summary> |
