def rehash(path, blocksize=<NUM_LIT:1> << <NUM_LIT:20>):<EOL>
h = hashlib.sha256()<EOL>length = <NUM_LIT:0><EOL>with open(path, '<STR_LIT:rb>') as f:<EOL><INDENT>for block in read_chunks(f, size=blocksize):<EOL><INDENT>length += len(block)<EOL>h.update(block)<EOL><DEDENT><DEDENT>digest = '<STR_LIT>' + urlsafe_b64encode(<EOL>h.digest()<EOL>).decode('<STR_LIT>').rstrip('<STR_LIT:=>')<EOL>return (digest, str(length))<EOL>
Return (hash, length) for path using hashlib.sha256()