Make icon cache save to disk

This commit is contained in:
2026-01-24 20:08:42 -07:00
parent 44b594a7f2
commit 8b69294674
6 changed files with 182 additions and 67 deletions

View File

@@ -66,38 +66,6 @@ public static class Tools
if (root.TryGetComponent<RectTransform>(out var rect)) LayoutRebuilder.ForceRebuildLayoutImmediate(rect);
}
public static (string, string) FixIconData(string i)
{
try
{
int t = i.Length;
int h = 128;
int d = t - h;
int a = d / 4;
int b = h / 4;
string D = string.Concat(
i.Substring(0, a),
i.Substring(a + b, a),
i.Substring(a * 2 + b * 2, a),
i.Substring(a * 3 + b * 3, d - a * 3)
);
string H = string.Concat(
i.Substring(a, b),
i.Substring(a * 2 + b, b),
i.Substring(a * 3 + b * 2, b),
i.Substring(a * 4 + b * 3, b)
);
return (D, H);
}
catch
{
return (null, null);
}
}
public static string Sha512Sum(byte[] data)
{
using var sha512 = SHA512.Create();