def compare(self, contents: str) -> bool:
        """Compare the file contents with the given hash"""
        if self.name == "none":
            return False

        return self.from_contents(contents, name=self.name) == self.checksum
Compare the file contents with the given hash
core/dbt/artifacts/resources/base.py