def get_resource_digest(resource):
    """Get a 'digest' version of the resource's body
    """
    try:
        digest = resource.get_structured_body(digest=True)
    except AttributeError:
        digest = resource
    return digest
