Compartir a través de


HashAlgorithm.TransformFinalBlock Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Computes the hash value for the specified region of the specified byte array.

Namespace:  System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Function TransformFinalBlock ( _
    inputBuffer As Byte(), _
    inputOffset As Integer, _
    inputCount As Integer _
) As Byte()
public byte[] TransformFinalBlock(
    byte[] inputBuffer,
    int inputOffset,
    int inputCount
)

Parameters

  • inputBuffer
    Type: array<System.Byte[]
    The input to compute the hash code for.
  • inputOffset
    Type: System.Int32
    The offset into the byte array from which to begin using data.
  • inputCount
    Type: System.Int32
    The number of bytes in the byte array to use as data.

Return Value

Type: array<System.Byte[]
An array that is a copy of the part of the input that is hashed.

Implements

ICryptoTransform.TransformFinalBlock(array<Byte[], Int32, Int32)

Exceptions

Exception Condition
ArgumentException

inputCount uses an invalid value.

-or-

inputBuffer has an invalid offset length.

ArgumentNullException

inputBuffer is nulla null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

inputOffset is out of range. This parameter cannot be a non-negative number.

ObjectDisposedException

The object has already been disposed.

Remarks

You must call the TransformFinalBlock method after calling the TransformBlock method but before you retrieve the final hash value.

Note that the return value of this method is not the hash value, but only a copy of the hashed part of the input data. To retrieve the final hashed value after calling the TransformFinalBlock method, get the byte array contained in the Hash property.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.