Returns the md5 digest of all interesting files (or glob) in `dirname`.

def digest(dirname, glob=None):
    """Returns the md5 digest of all interesting files (or glob) in `dirname`.
    """
    md5 = hashlib.md5()
    if glob is None:
        fnames = [fname for _, fname in list_files(Path(dirname))]
        for fname in sorted(fnames):
            fname = os.path.join(dirname, fname)
            md5.update(open(fname, 'rb').read())
    else:
        fnames = Path(dirname).glob(glob)
        for fname in sorted(fnames):
            md5.update(fname.open('rb').read())
    return md5.hexdigest()