Use HashCode
MODIFY
WalletWasabi/Helpers/HashHelpers.cs
WalletWasabi/Helpers/HashHelpers.cs
@@ -22,28 +22,14 @@ namespace WalletWasabi.Helpers
return hash;
}
- /// <summary>
- /// https://stackoverflow.com/a/468084/2061103
- /// </summary>
public static int ComputeHashCode(params byte[] data)
{
- unchecked
+ var hash = new HashCode();
+ foreach (var element in data)
{
- const int P = 16777619;
- int hash = (int)2166136261;
-
- for (int i = 0; i < data.Length; i++)
- {
- hash = (hash ^ data[i]) * P;
- }
-
- hash += hash << 13;
- hash ^= hash >> 7;
- hash += hash << 3;
- hash ^= hash >> 17;
- hash += hash << 5;
- return hash;
+ hash.Add(element);
}
+ return hash.ToHashCode();
}
}
}

Use HashCode