<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compute_hash(attributes, ignored_attributes=None):
 """ Computes a hash code for the given dictionary that is safe for persistence round trips """

    ignored_attributes = list(ignored_attributes) if ignored_attributes else []
    tuple_attributes = _convert(attributes.copy(), ignored_attributes)
    hasher = hashlib.sha256(str(tuple_attributes).encode('utf-8', errors='ignore'))
    return hasher.hexdigest()