def flat_rootname(filename: str) -> str:
    """A base for a flat file name to correspond to this file.

    Useful for writing files about the code where you want all the files in
    the same directory, but need to differentiate same-named files from
    different directories.

    For example, the file a/b/c.py will return 'z_86bbcbe134d28fd2_c_py'

    """
    dirname, basename = ntpath.split(filename)
    if dirname:
        fp = hashlib.new(
            "sha3_256",
            dirname.encode("UTF-8"),
            usedforsecurity=False,
        ).hexdigest()[:16]
        prefix = f"z_{fp}_"
    else:
        prefix = ""
    return prefix + basename.replace(".", "_")
A base for a flat file name to correspond to this file.

    Useful for writing files about the code where you want all the files in
    the same directory, but need to differentiate same-named files from
    different directories.

    For example, the file a/b/c.py will return 'z_86bbcbe134d28fd2_c_py'

    
coverage/files.py