public static string Sha256Hash(string toHash) { var hasher = new Hasher(HashProvider.SHA256); return 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 string MD5Hash(string toHash) { var hasher = new Hasher(HashProvider.MD5); return hasher.HashString(toHash); }
public static bool Sha256Compare(string compare, string hash) { var hasher = new Hasher(HashProvider.SHA256); return hasher.Compare(compare, hash); }
/// <summary> /// Compares a string to a hash to see if they match /// </summary> /// <param name="compare">String to hash and compare</param> /// <param name="hash">Expected hash result</param> /// <returns>true if they match, otherwise false</returns> public static bool MD5Compare(string compare, string hash) { var hasher = new Hasher(HashProvider.MD5); return hasher.Compare(compare, hash); }