Xceed Encryption Library Documentation
Hash method
Xceed Hashing control reference > Methods > Hash method

Description

The Hash method applies a hash function to data and provides a hash value (message digest). It can hash data in a single call, or it can be called multiple times to hash data in a streaming fashion.

After a successful call to this method, the resulting hash value is placed in the HashValue property.

Parameters
 

Parameter Description
vaSource  The data to hash. All OLE automation variant types are supported, including string and byte array variants.
bEndOfData  This parameter indicates to the library whether or not there is more data to hash.

If you only have a single block of data to hash, set this parameter to True. The library will then immediately produce and return a hash value for the data provided in the vaSource parameter.

 If you can only provide a portion of the data to hash in the vaSource parameter and will provide more data later in a subsequent call to the Hash method, set this parameter to False. In this case, the library will return an empty byte array. When the final portion of the data to hash has been provided, set the bEndOfData parameter to True. The method will then place the hash value for all the data provided into the HashValue property.

Return value

None

Associated properties

The type of hash function applied is determined by the HashingMethod property.

The length of the hash value is determined by the setting of the HashSize property.

Remarks

When calling the Hash method with the bEndOfData parameter specified as False, you cannot call any other Xceed Encryption control method (of the same instance of the control) until you have completed processing a stream of data by calling the Hash method with the bEndOfData parameter specified as True, or an error occurs, or the Reset method is called.

Declaration (DXceedEncryption) Copy Code
HRESULT Hash( [in] VARIANT* vaSource, [in] VARIANT_BOOL bEndOfData )
Declaration (IXceedEncryption) Copy Code

HRESULT Hash( [size_is][in] BYTE* pcSource, [in] DWORD dwSourceSize, [in] BOOL bEndOfData )