code: def sha1_of_file(filepath):
      
      import hashlib
      try:
          with open(filepath, 'rb') as file_to_hash:
              return hashlib.sha1(file_to_hash.read()).hexdigest()
      except:  # pylint: disable=bare-except
          return None
docs: Get sha1 of file
      :param filepath: File to hash
      :return: sha1 hash of file or None