Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ HashSpanToArray()

byte[] System.Security.Cryptography.ECDsa.HashSpanToArray ( ReadOnlySpan< byte > data,
HashAlgorithmName hashAlgorithm )
inlineprivateinherited

Definition at line 547 of file ECDsa.cs.

548 {
549 byte[] array = ArrayPool<byte>.Shared.Rent(data.Length);
550 bool flag = false;
551 try
552 {
553 data.CopyTo(array);
554 byte[] result = HashData(array, 0, data.Length, hashAlgorithm);
555 flag = true;
556 return result;
557 }
558 finally
559 {
560 Array.Clear(array, 0, data.Length);
561 if (flag)
562 {
564 }
565 }
566 }
static ArrayPool< T > Shared
Definition ArrayPool.cs:7
virtual byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm)
Definition ECDsa.cs:438
void CopyTo(Span< T > destination)

References System.array, System.Array.Clear(), System.ReadOnlySpan< T >.CopyTo(), System.Security.Cryptography.ECDsa.HashData(), System.ReadOnlySpan< T >.Length, and System.Buffers.ArrayPool< T >.Shared.

Referenced by System.Security.Cryptography.ECDsa.HashSpanToTmp().