Skip to content

Commit 15b082e

Browse files
committed
fix: use sha instead of getHashCode to fix version
1 parent e9182e9 commit 15b082e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Data.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
using System.IO;
1313
using System;
1414
using System.Windows.Media.Imaging;
15+
using System.Security.Cryptography;
16+
using System.Text;
1517

1618
namespace Community.PowerToys.Run.Plugin.Its_MyPic
1719
{
@@ -68,7 +70,7 @@ public Result ToResult(string search, Data data)
6870
}
6971
public class Data
7072
{
71-
private static readonly int DATA_VERSION = "なんで春日影やったの!?".GetHashCode();
73+
private static readonly int DATA_VERSION = BitConverter.ToInt32(SHA256.HashData(Encoding.UTF8.GetBytes("なんで春日影やったの!?")), 0);
7274
private readonly HttpClient client = new();
7375
readonly JsonSerializerOptions options = new() { PropertyNameCaseInsensitive = true, };
7476
public static string PluginDirectory => Main.PluginDirectory;
@@ -93,6 +95,7 @@ public Data()
9395
storage = new();
9496

9597
history = storage.Load();
98+
Log.Debug($"{history.Version} {DATA_VERSION}", GetType());
9699
if (history.Version != DATA_VERSION)
97100
{
98101
Log.Info("History is outdated, updateing", GetType());

0 commit comments

Comments
 (0)