mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 11:57:55 +02:00
* Remove legacy auth code * Adds tests so we don't break PasswordHash (again) * Clean up interfaces * Remove duplicate code * Use auto properties * static using * Don't use 'this' * Fix build
22 lines
594 B
C#
22 lines
594 B
C#
using System;
|
|
using System.Globalization;
|
|
|
|
namespace MediaBrowser.Common
|
|
{
|
|
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("-", "");
|
|
}
|
|
}
|