! @brief Estimate how many pages are the same using a CRC32 analyzer.

        A CRC32 analyzer program is loaded into target RAM and is passed an array of pages
        and sizes. When executed, it computes the CRC32 for every page.

        @param self
        @param assume_estimate_correct If set to True, then pages with matching CRCs will
            be marked as the same.  There is a small chance that the CRCs match even though the
            data is different, but the odds of this happing are low: ~1/(2^32) = ~2.33*10^-8%.

def _analyze_pages_with_crc32(self, assume_estimate_correct=False):
        """! @brief Estimate how many pages are the same using a CRC32 analyzer.

        A CRC32 analyzer program is loaded into target RAM and is passed an array of pages
        and sizes. When executed, it computes the CRC32 for every page.

        @param self
        @param assume_estimate_correct If set to True, then pages with matching CRCs will
            be marked as the same.  There is a small chance that the CRCs match even though the
            data is different, but the odds of this happing are low: ~1/(2^32) = ~2.33*10^-8%.
        """
        # Build list of all the pages that need to be analyzed
        sector_list = []
        page_list = []
        for page in self.page_list:
            if page.same is None:
                # Add page to compute_crcs
                sector_list.append((page.addr, page.size))
                page_list.append(page)
                # Compute CRC of data (Padded with 0xFF)
                data = list(page.data)
                pad_size = page.size - len(page.data)
                if pad_size > 0:
                    data.extend([0xFF] * pad_size)
                page.crc = crc32(bytearray(data)) & 0xFFFFFFFF

        # Analyze pages
        if len(page_list) > 0:
            self._enable_read_access()
            crc_list = self.flash.compute_crcs(sector_list)
            for page, crc in zip(page_list, crc_list):
                page_same = page.crc == crc
                if assume_estimate_correct:
                    page.same = page_same
                elif page_same is False:
                    page.same = False