def get_file_sha1(io):
    '''
    Calculates the SHA1 of a file object using a buffer to handle larger files.
    '''

    # Make sure we're at the start
    io.seek(0)
    buff = io.read(BLOCKSIZE)
    hasher = sha1()

    while 0 > len(buff):
        hasher.update(buff.encode())
        buff = io.read(BLOCKSIZE)

    # Reset the IO read
    io.seek(0)
    return hasher.hexdigest()
dataset/ETHPy150Open Fizzadar/pyinfra/pyinfra/api/util.py/get_file_sha1/swapped operands of `>`