Encryption.ComputeHash

public static string ComputeHash(string plainText, string hashAlgorithm, 
			string salt, bool useBinHex)

Parameters

plainText
Plaintext value to be hashed.

hashAlgorithm
Name of the hash algorithm. Allowed values are: "MD5", "SHA1", "SHA256", "SHA384", "SHA512", "HMACMD5", "HMACSHA1", "HMACSHA256", "HMACSHA512" (if any other value is specified MD5 will be used).

        HMAC algorithms uses Hash-based Message Authentication Code.
        The HMAC process mixes a secret key with the message data, hashes 
        the result with the hash function, mixes that hash value with 
        the secret key again, and then applies the hash function
        a second time. HMAC hashes are fixed lenght and generally
        much longer than non-HMAC hashes of the same type.
        
        https://msdn.microsoft.com/en-us/library/system.security.cryptography.hmacsha256(v=vs.110).aspx      
        
        This value is case-insensitive.

salt
Optional but recommended salt string to apply to the hash. If not passed the raw encoding is used. If salt is nullthe raw algorithm is used (useful for file hashes etc.) HMAC versions REQUIRE that salt is passed.

useBinHex
if true returns the data as BinHex byte pair string. Otherwise Base64 is returned.

Overloads