Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CryptoPool.cs
Go to the documentation of this file.
2
4
5internal static class CryptoPool
6{
7 internal static byte[] Rent(int minimumLength)
8 {
9 return ArrayPool<byte>.Shared.Rent(minimumLength);
10 }
11
12 internal static void Return(ArraySegment<byte> arraySegment)
13 {
14 Return(arraySegment.Array, arraySegment.Count);
15 }
16
17 internal static void Return(byte[] array, int clearSize = -1)
18 {
19 bool flag = clearSize < 0;
20 if (!flag && clearSize != 0)
21 {
22 CryptographicOperations.ZeroMemory(array.AsSpan(0, clearSize));
23 }
24 ArrayPool<byte>.Shared.Return(array, flag);
25 }
26}
static ArrayPool< T > Shared
Definition ArrayPool.cs:7
static void Return(byte[] array, int clearSize=-1)
Definition CryptoPool.cs:12
static void Return(ArraySegment< byte > arraySegment)
Definition CryptoPool.cs:12
static byte[] Rent(int minimumLength)
Definition CryptoPool.cs:7