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

◆ ComputeHash() [3/3]

byte[] System.Security.Cryptography.HashAlgorithm.ComputeHash ( Stream inputStream)
inlineinherited

Definition at line 118 of file HashAlgorithm.cs.

119 {
120 if (_disposed)
121 {
122 throw new ObjectDisposedException(null);
123 }
124 byte[] array = ArrayPool<byte>.Shared.Rent(4096);
125 int num = 0;
126 int num2;
127 while ((num2 = inputStream.Read(array, 0, array.Length)) > 0)
128 {
129 if (num2 > num)
130 {
131 num = num2;
132 }
133 HashCore(array, 0, num2);
134 }
135 CryptographicOperations.ZeroMemory(array.AsSpan(0, num));
138 }
static ArrayPool< T > Shared
Definition ArrayPool.cs:7
int Read(byte[] buffer, int offset, int count)
void HashCore(byte[] array, int ibStart, int cbSize)

References System.Security.Cryptography.HashAlgorithm._disposed, System.array, System.Security.Cryptography.HashAlgorithm.CaptureHashCodeAndReinitialize(), System.Security.Cryptography.HashAlgorithm.HashCore(), System.IO.Stream.Read(), System.Buffers.ArrayPool< T >.Shared, and System.Security.Cryptography.CryptographicOperations.ZeroMemory().