import hashlib
import base64


def old_compute_md5_for_file(filename, block_size=2**14):
    """Compute MD5 digest for a file

    Optional block_size parameter controls memory used to do MD5 calculation.
    This should be a multiple of 128 bytes.
    """
    f = open(filename, 'r', encoding='utf-8')
    md5 = hashlib.md5()
    while True:
        data = f.read(block_size)
        if not data:
            break
        md5.update(data.encode('utf-8'))
    f.close()
    return base64.b64encode(md5.digest()).decode('utf-8')