[#3] Move to netstandard 2.0

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
p.gross 2024-05-29 12:43:00 +03:00
parent ae3fc419a4
commit 0c4723c705
55 changed files with 2508 additions and 1818 deletions

View file

@ -1,30 +1,30 @@
using System.Security.Cryptography;
using System;
using System.Security.Cryptography;
namespace FrostFS.SDK.Cryptography.Tz
namespace FrostFS.SDK.Cryptography.Tz;
public static class Helper
{
public static class Helper
public static ulong NextUlong(this RandomNumberGenerator rng)
{
public static ulong NextUlong(this RandomNumberGenerator rng)
{
var buff = new byte[8];
rng.GetBytes(buff);
return BitConverter.ToUInt64(buff, 0);
}
var buff = new byte[8];
rng.GetBytes(buff);
return BitConverter.ToUInt64(buff, 0);
}
public static int GetLeadingZeros(ulong value)
public static int GetLeadingZeros(ulong value)
{
var i = 64;
while (value != 0)
{
var i = 64;
while (value != 0)
{
value >>= 1;
i--;
}
return i;
value >>= 1;
i--;
}
return i;
}
public static int GetNonZeroLength(this ulong value)
{
return 64 - GetLeadingZeros(value);
}
public static int GetNonZeroLength(this ulong value)
{
return 64 - GetLeadingZeros(value);
}
}