示例#1
0
 public void Return(IMultihashAlgorithm algo)
 {
     if (_cache.TryRemove(algo.GetHashCode(), out var export))
     {
         export?.Dispose();
     }
 }
示例#2
0
 private static Task <Multihash> SumAsync(IMultihashAlgorithm algo, byte[] data, int length) => algo.ComputeHashAsync(data).ContinueWith(t => new Multihash(algo.Code, t.Result.Slice(0, length != -1 ? length : algo.DefaultLength)));
示例#3
0
 private static Multihash Sum(IMultihashAlgorithm algo, byte[] data, int length) => new Multihash(algo.Code, algo.ComputeHash(data).Slice(0, length != -1 ? length : algo.DefaultLength));