[#28] Client: Move CalculateObjectId from IFrostFsClient to statis tools

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
Pavel Gross 2024-12-10 15:01:28 +03:00 committed by PavelGrossSpb
parent 543247e4d9
commit db9b93b2e6
4 changed files with 23 additions and 20 deletions

View file

@ -1,3 +1,4 @@
using System;
using System.Linq;
using FrostFS.Object;
@ -9,14 +10,34 @@ using Google.Protobuf;
namespace FrostFS.SDK.Client;
internal static class ObjectTools
public static class ObjectTools
{
internal static FrostFsObjectId CalculateObjectId(
public static FrostFsObjectId CalculateObjectId(
FrostFsObjectHeader header,
FrostFsOwner owner,
FrostFsVersion version,
ClientKey key)
{
if (header is null)
{
throw new ArgumentNullException(nameof(header));
}
if (owner is null)
{
throw new ArgumentNullException(nameof(owner));
}
if (version is null)
{
throw new ArgumentNullException(nameof(version));
}
if (key is null)
{
throw new ArgumentNullException(nameof(key));
}
var grpcHeader = CreateHeader(header, [], owner, version);
if (header.Split != null)