import hashlib


def md5sum_bytes(content):
    """Calculate md5sum of a byte string."""
    assert isinstance(content, bytes), 'Invalid type %s' % type(content)
    m = hashlib.md5()
    m.update(content)
    return m.hexdigest()