[#3] Move to netstandard 2.0
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
ae3fc419a4
commit
0c4723c705
55 changed files with 2508 additions and 1818 deletions
|
@ -1,8 +1,8 @@
|
|||
using System.Buffers.Binary;
|
||||
using System.Security.Cryptography;
|
||||
using FrostFS.SDK.Cryptography.Tz;
|
||||
using Google.Protobuf;
|
||||
using Org.BouncyCastle.Crypto.Digests;
|
||||
using System;
|
||||
using System.Buffers.Binary;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace FrostFS.SDK.Cryptography;
|
||||
|
||||
|
@ -31,10 +31,8 @@ public static class Helper
|
|||
|
||||
internal static byte[] Sha256(this ReadOnlySpan<byte> value)
|
||||
{
|
||||
var buffer = new byte[32];
|
||||
using var sha256 = SHA256.Create();
|
||||
sha256.TryComputeHash(value, buffer, out _);
|
||||
return buffer;
|
||||
return sha256.ComputeHash(value.ToArray());
|
||||
}
|
||||
|
||||
public static ByteString Sha256(this IMessage data)
|
||||
|
@ -47,18 +45,7 @@ public static class Helper
|
|||
return ByteString.CopyFrom(data.ToByteArray().Sha256());
|
||||
}
|
||||
|
||||
public static ByteString TzHash(this IMessage data)
|
||||
{
|
||||
return ByteString.CopyFrom(new TzHash().ComputeHash(data.ToByteArray()));
|
||||
}
|
||||
|
||||
public static ByteString TzHash(this ByteString data)
|
||||
{
|
||||
return ByteString.CopyFrom(new TzHash().ComputeHash(data.ToByteArray()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static ulong Murmur64(this byte[] value, uint seed)
|
||||
{
|
||||
using var murmur = new Murmur3_128(seed);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue