def compute_checksum(datafile):
    """Checksum is the sum of the differences between the
    minimum and maximum value on each line of a tab delimited
    data file.
    """
    checksum = 0
    with open(datafile, 'rb') as f:
        for line in f:
            # Remove trailing newline, split on tabs
            nums = [int(x) for x in line.strip(b'\n').split(b'\t')]
            checksum += max(nums) - min(nums)
    return checksum