def hash_file(filename):
    'Return the SHA1 (in hex format) of the contents of the given file.'
    block_size = (100 * 1024)
    sha1 = hashlib.sha1()
    with open(filename) as f:
        while True:
            data = f.read(block_size)
            if (not data):
                break
            sha1.update(data)
    return sha1.hexdigest()
Return the SHA1 (in hex format) of the contents of the given file.
def hash_file(filename):
    
    block_size = (100 * 1024)
    sha1 = hashlib.sha1()
    with open(filename) as f:
        while True:
            data = f.read(block_size)
            if (not data):
                break
            sha1.update(data)
    return sha1.hexdigest()