import hashlib


def calc_package_index_hash(deb_names):
    """
    Calculates a hash of all the given deb file names. This is deterministic so
    we can use it for short-circuiting.
    """
    md5 = hashlib.md5()
    md5.update("\n".join(sorted(deb_names)).encode('utf-8'))
    return md5.hexdigest()