#NEWLINE# def md5sum( file ) : #NEWLINE# #INDENT# "Calculate the md5 checksum of a file-like object without reading its\n    whole content in memory.\n\n    >>> from io import BytesIO\n    >>> md5sum(BytesIO(b'file content to hash'))\n    '784406af91dd5a54fbb9c84c2236595a'\n    " #NEWLINE# m = hashlib . md5 ( ) #NEWLINE# while True : #NEWLINE# #INDENT# d = file . read ( 8096 ) #NEWLINE# if ( not d ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# m . update ( d ) #NEWLINE# #UNINDENT# return m . hexdigest ( )