Sage Modeling and Simulation Library

Crypto..::..VerifyHash Method

Compares a hash of the specified plain text value to a given hash value. Plain text is hashed with the same salt value as the original hash.

Namespace:  Highpoint.Sage.Utility
Assembly:  Sage4 (in Sage4.dll)

Syntax


public static bool VerifyHash(
	string plainText,
	string hashAlgorithm,
	string hashValue
)

Parameters

plainText
Type: String
Plain text to be verified against the specified hash. The function does not check whether this parameter is null.
hashAlgorithm
Type: String
Name of the hash algorithm. Allowed values are: "MD5", "SHA1", "SHA256", "SHA384", and "SHA512" (if any other value is specified, MD5 hashing algorithm will be used). This value is case-insensitive.
hashValue
Type: String
Base64-encoded hash value produced by ComputeHash function. This value includes the original salt appended to it.

Return Value

If computed hash mathes the specified hash the function the return value is true; otherwise, the function returns false.