(file_, b64encode=True)
Compute the md5 digest of a file in base64 encoding.

    For ``b64encode``, returns the base64 encoded string; otherwise, returns the
    bytes directly.
Compute the md5 digest of a file in base64 encoding.
Compute the md5 digest of a file in base64 encoding .
def _file_md5(file_, b64encode=True):
    """
    Compute the md5 digest of a file in base64 encoding.

    For ``b64encode``, returns the base64 encoded string; otherwise, returns the
    bytes directly.
    """
    md5 = hashlib.md5()
    chunk_size = 128 * md5.block_size
    for chunk in iter(lambda: file_.read(chunk_size), b""):
        md5.update(chunk)
    file_.seek(0)
    byte_digest = md5.digest()
    if b64encode:
        return base64.b64encode(byte_digest).decode()
    else:
        return byte_digest
def _file_md5 ( file_ , b64encode = True ) : md5 = hashlib . md5 ( ) chunk_size = 128 * md5 . block_size for chunk in iter ( lambda : file_ . read ( chunk_size ) , b"" ) : md5 . update ( chunk ) file_ . seek ( 0 ) byte_digest = md5 . digest ( ) if b64encode : return base64 . b64encode ( byte_digest ) . decode ( ) else : return byte_digest