import hashlib


def inacademia_hinting_hash(data):
    """
    Hash data the same way this is done in the inacademia-hinting code.

    This code should not be changed on its own - if needed, it should be
    changed in-sync with the inacademia-hinting code.
    """
    raw = data.encode("utf-8") if isinstance(data, str) else data
    hash = hashlib.sha1(raw).hexdigest()
    return hash