HashAlgorithm

HashAlgorithm


Represents a common interface implemented by all hashing algorithms.


Remarks

A hash is a fixed-length data that can represent unique variable-length data. The size of the hash determines the ability for different data to have a unique hash value. Since hash values are fixed-length, there are a fixed number of possible hash values, which must represent an infinite number of variable-length data.

Hashes are powerful in that a tiny change in the input data will cause a large change in the computed hash value. This provides the ability to detect when data has been altered.

It is possible for two variable-length data to have the same hash value, but the chances are so remote as to be practically impossible. The larger the hash value, the more impractical is becomes to find a duplicate hash value.

See Also

Project VBCorLib Overview | SHA1CryptoServiceProvider | SHA1Managed | SHA256Managed | SHA384Managed | SHA512Managed | RIPEMD160Managed | MD5CryptoServiceProvider

Public:

Properties:

NameDescription
 CanReuseTransform (get)Returns if the hash algorithm implementation can be reused once a hash has been computed. 
 CanTransformMultipleBlocks (get)Returns if the hash algorithm implementation can processd multiple blocks of data at a time. 
 Hash (get)Returns the computed hash after all data has been processed. 
 HashSize (get)Returns the size of the hash value in bits. 
 InputBlockSize (get)Returns the size of the input block size allowed. 
 OutputBlockSize (get)Returns the size of the output block. 

Methods:

NameDescription
 ClearReleases any resources being held by the hash algorithm. 
 ComputeHashComputes the hash on a source in its entirety. 
 EqualsReturns if the Value is equal to this object instance. 
 GetHashCodeReturns a pseudo-unique number identifying this instance. 
 InitializeResets a hashing object to begin hashing a new value. 
 ToStringReturns a string representation of this object instance. 
 TransformBlockContinues to compute the hash value for blocks of data. 
 TransformFinalBlockFinalizes the hash computation by processing the last block of data.