def get_target_hash(target_filepath):
<EOL>securesystemslib.formats.RELPATH_SCHEMA.check_match(target_filepath)<EOL>digest_object = securesystemslib.hash.digest(HASH_FUNCTION)<EOL>encoded_target_filepath = target_filepath.encode('<STR_LIT:utf-8>')<EOL>digest_object.update(encoded_target_filepath)<EOL>target_filepath_hash = digest_object.hexdigest()<EOL>return target_filepath_hash<EOL>
<Purpose>
  Compute the hash of 'target_filepath'. This is useful in conjunction with
  the "path_hash_prefixes" attribute in a delegated targets role, which tells
  us which paths it is implicitly responsible for.

  The repository may optionally organize targets into hashed bins to ease
  target delegations and role metadata management.  The use of consistent
  hashing allows for a uniform distribution of targets into bins.

<Arguments>
  target_filepath:
    The path to the target file on the repository. This will be relative to
    the 'targets' (or equivalent) directory on a given mirror.

<Exceptions>
  None.

<Side Effects>
  None.

<Returns>
  The hash of 'target_filepath'.