code: def _get_entry_hash_name(
      index: Union["Index", "IndexView"],
      workspace: str,
      key: "DataIndexKey",
  ) -> str:
      from dvc_data.hashfile.hash import DEFAULT_ALGORITHM
  
      for idx in reversed(range(len(key) + 1)):
          prefix = key[:idx]
          try:
              src_entry = index.data[workspace][prefix]
          except KeyError:
              continue
  
          if src_entry.hash_info and src_entry.hash_info.name:
              return src_entry.hash_info.name
  
      return DEFAULT_ALGORITHM
  
imports: import logging
  import time
  from collections import defaultdict
  from functools import partial
  from itertools import chain
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, List, NamedTuple, Optional, Set, Tuple, Union
  from funcy.debug import format_time
  from dvc.dependency import ParamsDependency
  from dvc.fs import LocalFileSystem
  from dvc.fs.callbacks import DEFAULT_CALLBACK
  from dvc.log import logger
  from dvc.utils.objects import cached_property
label_desc: Use image node_id 9 for calling a global function with example usage: _get_entry_hash_name(index, workspace, key) and returns: DEFAULT_ALGORITHM, src_entry