Files
ersatztv/ErsatzTV.Core/PathUtils.cs
T
Jason DoveandGitHub ab0f431c85 fix app startup with mysql (#2205)
* don't run pragma command on mysql

* add not required pathhash

* make media file path hash required

* update changelog
2025-07-26 17:48:03 +00:00

19 lines
483 B
C#

using System.Globalization;
using System.Security.Cryptography;
using System.Text;
namespace ErsatzTV.Core;
public static class PathUtils
{
public static string GetPathHash(string path)
{
byte[] bytes = SHA256.HashData(Encoding.UTF8.GetBytes(path));
var builder = new StringBuilder();
foreach (byte b in bytes)
{
builder.Append(b.ToString("x2", CultureInfo.InvariantCulture));
}
return builder.ToString();
}
}