Generates a hash for the given plain text value and returns a base64-encoded result. Before the hash is computed, a random salt is generated and appended to the plain text. This salt is stored at the end of the hash value, so it can be used later for hash verification.

public static string ComputeHash(string plainText,
	string hashAlgorithm,
	Byte[] saltBytes)

Return Value

Hash value formatted as a base64-encoded string.


Plaintext value to be hashed. The function does not check whether this parameter is null.

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.

Salt bytes. This parameter can be null, in which case a random salt value will be generated.


See also:

Class HashFunctions