def convert_to_hash(self, data_to_hash):
        """Convert json data records to hash.

        Args:
            data_to_hash (list): list of data to hash

        Returns:
            list: hashed data list
        """
        __method_name = inspect.currentframe().f_code.co_name
        hashed_data = []
        for record in data_to_hash:
            try:
                json_string = json.dumps(record)
                res_hash = hashlib.sha256(
                    json_string.encode("utf-8", errors="replace")
                ).hexdigest()
                hashed_data.append(res_hash)
            except TypeError as err:
                applogger.error(
                    self.log_format.format(
                        consts.LOGS_STARTS_WITH,
                        __method_name,
                        self.azure_function_name,
                        consts.TYPE_ERROR_MSG.format(err),
                    )
                )
                continue
            except ValueError as err:
                applogger.error(
                    self.log_format.format(
                        consts.LOGS_STARTS_WITH,
                        __method_name,
                        self.azure_function_name,
                        consts.VALUE_ERROR_MSG.format(err),
                    )
                )
                continue
            except Exception as err:
                applogger.error(
                    self.log_format.format(
                        consts.LOGS_STARTS_WITH,
                        __method_name,
                        self.azure_function_name,
                        consts.UNEXPECTED_ERROR_MSG.format(err),
                    )
                )
                continue
        return hashed_data
Convert json data records to hash.

        Args:
            data_to_hash (list): list of data to hash

        Returns:
            list: hashed data list
        
Solutions/Mimecast/Data Connectors/MimecastAT/SharedCode/utils.py