public static string Sha256Hash(string toHash, string salt) { var hasher = new SaltedHasher(HashProvider.SHA256); // Use the predefined salt if specified return salt != null ? hasher.HashString(toHash, salt) : hasher.HashString(toHash); }
/// <summary> /// Computes the 32-character hex string MD5 Hash of the passed string /// </summary> /// <param name="toHash">The string to hash</param> /// <returns>32-character hex MD5 hash</returns> public static new string MD5Hash(string toHash) { var hasher = new SaltedHasher(HashProvider.MD5); return hasher.HashString(toHash); }