mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-04 14:58:36 +01:00
Check checksum for plugin downloads
* Compare the MD5 checksum when downloading plugins * Reduced log spam due to http requests * Removed 'GetTempFileResponse' function from HttpClientManager * Fixed caching for HttpClientManager
This commit is contained in:
22
MediaBrowser.Common/Extensions/HexHelper.cs
Normal file
22
MediaBrowser.Common/Extensions/HexHelper.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace MediaBrowser.Common.Extensions
|
||||
{
|
||||
public static class HexHelper
|
||||
{
|
||||
public static byte[] FromHexString(string str)
|
||||
{
|
||||
byte[] bytes = new byte[str.Length / 2];
|
||||
for (int i = 0; i < str.Length; i += 2)
|
||||
{
|
||||
bytes[i / 2] = byte.Parse(str.Substring(i, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public static string ToHexString(byte[] bytes)
|
||||
=> BitConverter.ToString(bytes).Replace("-", "");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user