import hashlib


def md5sum(filename, blocksize=65536):
    """Generate md5 sum"""
    hsh = hashlib.md5()
    with open(filename, 'rb') as f_handle:
        for block in iter(lambda: f_handle.read(blocksize), b''):
            hsh.update(block)
    return hsh.hexdigest()