[#18] Client: Rename parameters
Signed-off-by: Pavel Gross <p.gross@yando.com>
This commit is contained in:
parent
816e1eb2f1
commit
3206abc33e
31 changed files with 200 additions and 142 deletions
25
src/FrostFS.SDK.ModelsV2/Misc/CheckSum.cs
Normal file
25
src/FrostFS.SDK.ModelsV2/Misc/CheckSum.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace FrostFS.SDK.ModelsV2;
|
||||
|
||||
public class CheckSum
|
||||
{
|
||||
public byte[]? Hash { get; set; }
|
||||
|
||||
public static byte[] GetHash(byte[] content)
|
||||
{
|
||||
var sha256 = SHA256.Create();
|
||||
return sha256.ComputeHash(content);
|
||||
}
|
||||
|
||||
public static CheckSum CreateCheckSum(byte[] content)
|
||||
{
|
||||
return new CheckSum { Hash = GetHash(content) };
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Encoding.UTF8.GetString(Hash);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue