HashAlgorithm.TryHashFinal(Span<Byte>, Int32) Метод
Определение
Пытается завершить вычисление хэша после обработки последних данных хэш-алгоритмом.Attempts to finalize the hash computation after the last data is processed by the hash algorithm.
protected:
virtual bool TryHashFinal(Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten);
protected virtual bool TryHashFinal (Span<byte> destination, out int bytesWritten);
abstract member TryHashFinal : Span<byte> * int -> bool
override this.TryHashFinal : Span<byte> * int -> bool
Protected Overridable Function TryHashFinal (destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean
Параметры
- bytesWritten
- Int32
Этот метод возвращает общее количество байтов, записанных в destination
.When this method returns, the total number of bytes written into destination
. Этот параметр обрабатывается как неинициализированный.This parameter is treated as uninitialized.
Возвращаемое значение
Значение true
, если destination
имеет достаточную длину для получения хэш-значения, в противном случае — значение false
.true
if destination
is long enough to receive the hash value; otherwise, false
.
Комментарии
Реализация по умолчанию этого метода заключается в вызове HashFinal() и копировании результата в destination
.The default implementation of this method is to call HashFinal() and copy the result to destination
.
Производные типы должны переопределять этот метод, чтобы избежать создания промежуточного массива.Derived types should override this method to avoid the intermediate array creation.
Все вызовы этого метода HashAlgorithm класса уже прошли проверку destination
на наличие достаточного значения в зависимости от HashSize свойства, поэтому false
Возврат значений является неожиданным.All calls to this method by the HashAlgorithm class have already verified that destination
is long enough based on the HashSize property, so false
return values are unexpected.