[#3] Move to netstandard 2.0
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
ae3fc419a4
commit
0c4723c705
55 changed files with 2508 additions and 1818 deletions
|
@ -1,23 +1,24 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace FrostFS.SDK.Cryptography
|
||||
namespace FrostFS.SDK.Cryptography;
|
||||
|
||||
internal static class ArrayHelper
|
||||
{
|
||||
internal static class ArrayHelper
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static byte[] Concat(params byte[][] buffers)
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static byte[] Concat(params byte[][] buffers)
|
||||
var length = buffers.Sum(buffer => buffer.Length);
|
||||
|
||||
var dst = new byte[length];
|
||||
var p = 0;
|
||||
foreach (var src in buffers)
|
||||
{
|
||||
var length = buffers.Sum(buffer => buffer.Length);
|
||||
|
||||
var dst = new byte[length];
|
||||
var p = 0;
|
||||
foreach (var src in buffers)
|
||||
{
|
||||
Buffer.BlockCopy(src, 0, dst, p, src.Length);
|
||||
p += src.Length;
|
||||
}
|
||||
|
||||
return dst;
|
||||
Buffer.BlockCopy(src, 0, dst, p, src.Length);
|
||||
p += src.Length;
|
||||
}
|
||||
|
||||
return dst;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue