import hashlib


def sha1_file(filename):
    """
    Return the hex string representation of the SHA1 checksum of the filename
    """

    s = hashlib.sha1()
    with open(filename, "rb") as f:
        for line in f:
            s.update(line)
    return s.hexdigest()