Computes a hash code for the given dictionary that is safe for persistence round trips

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()