Hash
Hash
Summary
| Method | |
|---|---|
| Add | |
| Clear | |
| Property | |
|---|---|
| Hash | |
| Type | |
The Hash object is used to calculate a one-way hash, the value of which is a fixed length "string", from an arbitrary length data set. This is often referred to as calculating the "message digest" of a "message". The data set will typically be the contents of a document or form, in which case the hash value will be a unique and reliable "digital fingerprint" of the contents.
To be secure, the algorithms used to calculate hash values must be such that it is not possible to forge a data set in order to yield a given hash value. Two of the most widely used and secure hash algorithms are MD5 (which produces a 128-bit hash value) and SHA (which produces a 160-bit hash value). The latter has been adopted as a Federal Information Processing Standard.
Methods
Add
Adds a data item to the data set from which the hash value is calculated. When an item is added, the Hash property is automatically updated with the new value of the one-way hash.
| void Add(Data) | |
|---|---|
| Parameters | |
| Data | Variant containing the data item to add. Most automation-compatible data types may be added to the data set, including the following types: boolean, Byte, Byte(), Currency, Date, Double, Integer, Long, Single, String. Attempting to add an unsupported data type results in a run-time error. |
| Return Value | |
| None | |
Clear
Clears the current data set from the Hash object, thus resetting the object for the calculation of a new hash value.
| void Clear() | |
|---|---|
| Parameters | |
| None | |
| Return Value | |
| None |
Properties
Clears the current data set from the Hash object, thus resetting the object for the calculation of a new hash value.
| Property | Property Type | Description |
|---|---|---|
Hash | String | Returns the current hash value as a string.Note: This property is used internally by the component and is not intended for use by the client programmer. (Read-only) |
Type | HashType (Enum) | Gets and sets the type of hash algorithm used. See Enumerator Types for possible values. May be set only if a Hash object contains no data. An attempt to set Type after data has been added will result in an error.Default = HashNone, therefore the Type must be reset to a defined algorithm prior to using the Hash object. |