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

◆ TryHashFinal()

virtual bool System.Security.Cryptography.HashAlgorithm.TryHashFinal ( Span< byte > destination,
out int bytesWritten )
inlineprotectedvirtualinherited

Reimplemented in System.Security.Cryptography.HMACMD5, System.Security.Cryptography.HMACSHA1, System.Security.Cryptography.HMACSHA256, System.Security.Cryptography.HMACSHA384, System.Security.Cryptography.HMACSHA512, System.Security.Cryptography.MD5.Implementation, System.Security.Cryptography.SHA1.Implementation, System.Security.Cryptography.SHA1Managed, System.Security.Cryptography.SHA256.Implementation, System.Security.Cryptography.SHA256Managed, System.Security.Cryptography.SHA384.Implementation, System.Security.Cryptography.SHA384Managed, System.Security.Cryptography.SHA512.Implementation, System.Security.Cryptography.SHA512Managed, System.Security.Cryptography.MD5CryptoServiceProvider, System.Security.Cryptography.SHA1CryptoServiceProvider, System.Security.Cryptography.SHA256CryptoServiceProvider, System.Security.Cryptography.SHA384CryptoServiceProvider, System.Security.Cryptography.SHA512CryptoServiceProvider, and System.Security.Cryptography.HMAC.

Definition at line 269 of file HashAlgorithm.cs.

270 {
271 int num = HashSizeValue / 8;
272 if (destination.Length >= num)
273 {
274 byte[] array = HashFinal();
275 if (array.Length == num)
276 {
277 new ReadOnlySpan<byte>(array).CopyTo(destination);
278 bytesWritten = array.Length;
279 return true;
280 }
282 }
283 bytesWritten = 0;
284 return false;
285 }
static string InvalidOperation_IncorrectImplementation
Definition SR.cs:72
Definition SR.cs:7

References System.array, System.ReadOnlySpan< T >.CopyTo(), System.destination, System.Security.Cryptography.HashAlgorithm.HashFinal(), System.Security.Cryptography.HashAlgorithm.HashSizeValue, and System.SR.InvalidOperation_IncorrectImplementation.

Referenced by System.Security.Cryptography.HashAlgorithm.TryComputeHash().