Add migrated to .NET 8.0 variant of Hcs.Client

This commit is contained in:
2025-09-26 19:48:32 +09:00
parent da127df8f6
commit 6cd2fb82e9
503 changed files with 223796 additions and 0 deletions

View File

@ -0,0 +1,23 @@
using GostCryptography.Config;
using System;
namespace GostXades.Helpers
{
public static class GostHashAlgorithmHelper
{
/// <summary>
/// Рассчитать хэш
/// </summary>
/// <param name="cryptoProviderType">Тип криптопровайдера</param>
/// <param name="bytes"></param>
/// <returns></returns>
public static string ComputeHash(CryptoProviderTypeEnum cryptoProviderType, byte[] bytes)
{
byte[] hashValue;
GostCryptoConfig.ProviderType = (GostCryptography.Base.ProviderType)cryptoProviderType;
var hashAlgorithm = new GostCryptography.Gost_R3411.Gost_R3411_2012_512_HashAlgorithm();
hashValue = hashAlgorithm.ComputeHash(bytes);
return BitConverter.ToString(hashValue).Replace("-", "");
}
}
}