VB example Delphi example VC++ example C# example VB.NET example
How to hash a memory buffer's data in a single pass
How to hash streaming data
To obtain the hash value of a memory buffer in a single pass, perform the following steps. Put the Xceed Hashing control on a form or instantiate it, then:
Specify the hashing method to use. To do this, create an instance of the XceedSHAHashingMethod or XceedHavalHashingMethod object and assign it to the HashingMethod property.
Specify the size (in bits) of the desired hash value. To do this, set the HashSize property.
Tell the library to hash the data. To do this, call the Hash method, passing the memory buffer containing the data to hash and True for the bEndOfData parameter.
Obtain the hash value. To do this, read the contents of the HashValue property.
Make sure that everything worked properly. To do this, use your language's error handling object or error handling capabilities. The Xceed Encryption Library supports standard COM error handling functionality.
To obtain the hash value from streaming data, perform the following steps. Put the Xceed Hashing control on a form or instantiate it, then:
Specify the hashing method to use. To do this, create an instance of the XceedSHAHashingMethod or XceedHavalHashingMethod object and assign it to the HashingMethod property.
Specify the size (in bits) of the desired hash value. To do this, set the HashSize property.
Provide some data to the library to hash. To do this, call the Hash method, passing the first buffer of the data to hash, and False for the bEndOfData parameter.
Continue providing data to hash. Call the Hash method again with more buffers, always specifying False for bEndOfData. When you have provided the final buffer to the library, set bEndOfData to True when calling the Hash method.
Obtain the hash value. To do this, read the contents of the HashValue property.
Make sure that everything worked properly. To do this, use your language's error handling object or error handling capabilities. The Xceed Encryption Library supports standard COM error handling functionality.