(path, blocksize=1 << 20)
return (h, length)
Return (hash, length) for path using hashlib.sha256()
Return (hash, length) for path using hashlib.sha256()
Return ( hash length ) for path using hashlib . sha256 ()
def hash_file(path, blocksize=1 << 20):
    # type: (str, int) -> Tuple[Any, int]
    """Return (hash, length) for path using hashlib.sha256()"""
    h = hashlib.sha256()
    length = 0
    with open(path, 'rb') as f:
        for block in read_chunks(f, size=blocksize):
            length += len(block)
            h.update(block)
    return (h, length)
def hash_file ( path , blocksize = 1 << 20 ) : # type: (str, int) -> Tuple[Any, int] h = hashlib . sha256 ( ) length = 0 with open ( path , 'rb' ) as f : for block in read_chunks ( f , size = blocksize ) : length += len ( block ) h . update ( block ) return ( h , length )