[#16] Remove Tz fix formating

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
Pavel Gross 2024-07-11 11:17:48 +03:00 committed by p.gross
parent fefa2da218
commit 00a1e9412f
15 changed files with 123 additions and 723 deletions

View file

@ -1,7 +1,5 @@
using Google.Protobuf;
using Org.BouncyCastle.Crypto.Digests;
using System;
using System.Buffers.Binary;
using System.Security.Cryptography;
namespace FrostFS.SDK.Cryptography;
@ -20,35 +18,11 @@ public static class Extentions
public static byte[] Sha256(this byte[] value)
{
using var sha256 = SHA256.Create();
var sha256 = SHA256.Create();
return sha256.ComputeHash(value);
}
internal static byte[] Sha256(this byte[] value, int offset, int count)
{
using var sha256 = SHA256.Create();
return sha256.ComputeHash(value, offset, count);
}
internal static byte[] Sha256(this ReadOnlySpan<byte> value)
{
using var sha256 = SHA256.Create();
return sha256.ComputeHash(value.ToArray());
}
public static ByteString Sha256(this IMessage data)
{
return ByteString.CopyFrom(data.ToByteArray().Sha256());
}
public static ByteString Sha256(this ByteString data)
{
return ByteString.CopyFrom(data.ToByteArray().Sha256());
}
public static ulong Murmur64(this byte[] value, uint seed)
{
using var murmur = new Murmur3_128(seed);
return BinaryPrimitives.ReadUInt64LittleEndian(murmur.ComputeHash(value));
}
}