Tpm2Lib.TpmHash.operator C# (CSharp) Method

operator() public static method

Returns true if the two hashes are equal, i.e. if both hash algorithms and digests are the same. When this operator is used to compare a hash object with a byte buffer representing digest, the latter is converted to a hash object with its hash algorithm set to null, which excludes the algorithms from comparison).
public static operator ( ) : bool
return bool
        public static bool operator == (TpmHash lhs, TpmHash rhs)
        {
            return (object)lhs == null ? (object)rhs == null
                                       : (object)rhs != null &&
                        (lhs._HashAlg == TpmAlgId.None || rhs._HashAlg == TpmAlgId.None ||
                         lhs._HashAlg == rhs._HashAlg) &&
                        Globs.ArraysAreEqual(lhs._HashData, rhs._HashData);
        }