'Generate an etag for the response object using an MD5 hash of
the body (the body parameter, or ``self.body`` if not given)
Sets ``self.etag``
If ``set_content_md5`` is True sets ``self.content_md5`` as well'

def md5_etag(self, body=None, set_content_md5=False):

    if (body is None):
        body = self.body
    md5_digest = md5(body).digest()
    md5_digest = b64encode(md5_digest)
    md5_digest = md5_digest.replace('\n', '')
    md5_digest = native_(md5_digest)
    self.etag = md5_digest.strip('=')
    if set_content_md5:
        self.content_md5 = md5_digest
