Compute checksum for each file in `directory`, with exception of files
    specified in `blacklist`.

    Args:
        directory (str): Absolute or relative path to the directory.
        blacklist (list/set/tuple): List of blacklisted filenames. Only
                  filenames are checked, not paths!

    Returns:
        str: Content of hashfile as it is specified in ABNF specification for \
             project.

def generate_hashfile(directory, blacklist=_BLACKLIST):
    """
    Compute checksum for each file in `directory`, with exception of files
    specified in `blacklist`.

    Args:
        directory (str): Absolute or relative path to the directory.
        blacklist (list/set/tuple): List of blacklisted filenames. Only
                  filenames are checked, not paths!

    Returns:
        str: Content of hashfile as it is specified in ABNF specification for \
             project.
    """
    checksums = generate_checksums(directory, blacklist)

    out = ""
    for fn, checksum in sorted(checksums.items()):
        out += "%s %s\n" % (checksum, fn)

    return out