import hashlib


def digest_data(data: bytes):
    """Compute the digest of a given input byte string, which are the first
    8 bytes of its sha256 hash."""
    m = hashlib.sha256()
    m.update(data)
    return m.digest()[:8]