[#1] Move files to top level directory
Signed-off-by: Ivan Pchelintsev <i.pchelintsev@yadro.com>
This commit is contained in:
parent
013d8a8436
commit
11eff4e23e
76 changed files with 0 additions and 0 deletions
24
src/FrostFS.SDK.Cryptography/ArrayHelper.cs
Normal file
24
src/FrostFS.SDK.Cryptography/ArrayHelper.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace FrostFS.SDK.Cryptography
|
||||
{
|
||||
internal static class ArrayHelper
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static byte[] Concat(params byte[][] buffers)
|
||||
{
|
||||
int length = 0;
|
||||
for (int i = 0; i < buffers.Length; i++)
|
||||
length += buffers[i].Length;
|
||||
byte[] dst = new byte[length];
|
||||
int p = 0;
|
||||
foreach (byte[] src in buffers)
|
||||
{
|
||||
Buffer.BlockCopy(src, 0, dst, p, src.Length);
|
||||
p += src.Length;
|
||||
}
|
||||
|
||||
return dst;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue