def METHOD_NAME(path: Path) -> str:
    """Compute a key for a given path using a hash function.
    If the path is relative to the NiceGUI base directory, the key is computed from the relative path.
    """
    nicegui_base = Path(__file__).parent
    try:
        path = path.relative_to(nicegui_base)
    except ValueError:
        pass
    return f'{hash_file_path(path.parent)}/{path.name}'