import hashlib


def hash_versions(version_kf_ids):
    """
    Uniquely identify a set of file Versions by computing an MD5 hash digest
    using the primary keys of the Versions
    """
    version_id_str = "".join(sorted(v for v in version_kf_ids))
    return hashlib.md5(version_id_str.encode("utf-8")).hexdigest()