Remove runtime serializer hash residue
This commit is contained in:
parent
8543949969
commit
23a5241a7d
4 changed files with 80 additions and 37 deletions
|
|
@ -1,20 +1,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public static class CollectionExtensions
|
||||
{
|
||||
// https://stackoverflow.com/a/800469
|
||||
public static string GetHashSHA1(this byte[] data)
|
||||
{
|
||||
using (var sha1 = new System.Security.Cryptography.SHA1CryptoServiceProvider())
|
||||
{
|
||||
return string.Concat(sha1.ComputeHash(data).Select(x => x.ToString("X2")));
|
||||
}
|
||||
}
|
||||
|
||||
// https://stackoverflow.com/a/3188835
|
||||
public static T MaxBy<T, U>(this IEnumerable<T> items, Func<T, U> selector)
|
||||
{
|
||||
|
|
@ -73,4 +63,4 @@ public static class AsyncAwaitExtensions
|
|||
{
|
||||
await task;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue