def get_file_details(filepath, hash_algorithms=['<STR_LIT>']):
<EOL>securesystemslib.formats.PATH_SCHEMA.check_match(filepath)<EOL>securesystemslib.formats.HASHALGORITHMS_SCHEMA.check_match(hash_algorithms)<EOL>file_hashes = {}<EOL>if not os.path.exists(filepath):<EOL><INDENT>raise securesystemslib.exceptions.Error('<STR_LIT>' + repr(filepath) + '<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>filepath = os.path.abspath(filepath)<EOL>file_length = os.path.getsize(filepath)<EOL>for algorithm in hash_algorithms:<EOL><INDENT>digest_object = securesystemslib.hash.digest_filename(filepath, algorithm)<EOL>file_hashes.update({algorithm: digest_object.hexdigest()})<EOL><DEDENT>securesystemslib.formats.HASHDICT_SCHEMA.check_match(file_hashes)<EOL>return file_length, file_hashes<EOL>
<Purpose>
  To get file's length and hash information.  The hash is computed using the
  sha256 algorithm.  This function is used in the signerlib.py and updater.py
  modules.

<Arguments>
  filepath:
    Absolute file path of a file.

  hash_algorithms:

<Exceptions>
  securesystemslib.exceptions.FormatError: If hash of the file does not match
  HASHDICT_SCHEMA.

  securesystemslib.exceptions.Error: If 'filepath' does not exist.

<Returns>
  A tuple (length, hashes) describing 'filepath'.