Remove Hex class as the BCL has one now

This commit is contained in:
Bond_009
2020-11-25 23:40:31 +01:00
parent 9534f55eb0
commit 8c8a71692e
12 changed files with 13 additions and 233 deletions

View File

@@ -647,7 +647,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
{
using var options = new HttpRequestMessage(HttpMethod.Post, ApiUrl + "/token");
var hashedPasswordBytes = _cryptoProvider.ComputeHash("SHA1", Encoding.ASCII.GetBytes(password), Array.Empty<byte>());
string hashedPassword = Hex.Encode(hashedPasswordBytes);
string hashedPassword = Convert.ToHexString(hashedPasswordBytes);
options.Content = new StringContent("{\"username\":\"" + username + "\",\"password\":\"" + hashedPassword + "\"}", Encoding.UTF8, MediaTypeNames.Application.Json);
using var response = await Send(options, false, null, cancellationToken).ConfigureAwait(false);

View File

@@ -243,7 +243,7 @@ namespace Emby.Server.Implementations.QuickConnect
Span<byte> bytes = stackalloc byte[length];
_rng.GetBytes(bytes);
return Hex.Encode(bytes);
return Convert.ToHexString(bytes);
}
/// <inheritdoc/>

View File

@@ -414,7 +414,7 @@ namespace Emby.Server.Implementations.Updates
using var md5 = MD5.Create();
cancellationToken.ThrowIfCancellationRequested();
var hash = Hex.Encode(md5.ComputeHash(stream));
var hash = Convert.ToHexString(md5.ComputeHash(stream));
if (!string.Equals(package.Checksum, hash, StringComparison.OrdinalIgnoreCase))
{
_logger.LogError(