(self, file1: PATH_TYPES, file2: PATH_TYPES)
return file1_hash == file2_hash
Compare two files, returning true if they are the same and False if not.
Compare two files, returning true if they are the same and False if not.
Compare two files returning true if they are the same and False if not .
def compare_files(self, file1: PATH_TYPES, file2: PATH_TYPES) -> bool:
        """Compare two files, returning true if they are the same and False if not."""
        file1_contents = self.read_file(file1, text=False)
        file2_contents = self.read_file(file2, text=False)
        assert isinstance(file1_contents, bytes)
        assert isinstance(file2_contents, bytes)
        file1_hash = hashlib.sha256(file1_contents).hexdigest()
        file2_hash = hashlib.sha256(file2_contents).hexdigest()
        return file1_hash == file2_hash
def compare_files ( self , file1 : PATH_TYPES , file2 : PATH_TYPES ) -> bool : file1_contents = self . read_file ( file1 , text = False ) file2_contents = self . read_file ( file2 , text = False ) assert isinstance ( file1_contents , bytes ) assert isinstance ( file2_contents , bytes ) file1_hash = hashlib . sha256 ( file1_contents ) . hexdigest ( ) file2_hash = hashlib . sha256 ( file2_contents ) . hexdigest ( ) return file1_hash == file2_hash