code: def get_hash_of_files(root_path, directories=None):
      
      if not directories:
          directories = [{'path': './'}]
  
      files_to_hash = []
      for i in directories:
          ignorer = get_ignorer(os.path.join(root_path, i['path']),
                                i.get('exclusions'))
  
          with change_dir(root_path):
              for root, dirs, files in os.walk(i['path'], topdown=True):
                  if (root != './') and ignorer.is_ignored(root, True):
                      dirs[:] = []
                      files[:] = []
                  else:
                      for filename in files:
                          filepath = os.path.join(root, filename)
                          if not ignorer.is_ignored(filepath):
                              files_to_hash.append(
                                  filepath[2:] if filepath.startswith('./') else filepath  # noqa
                              )
  
      return calculate_hash_of_files(files_to_hash, root_path)
docs: Generate md5 hash of files.