code: def hamming(str1: str, str2: str) -> float:
      """
      Compute the similarity between two strings using Hamming distance,
      which gives the number of characters at corresponding string indices that differ,
      including chars in the longer string that have no correspondents in the shorter.
  
      Args:
          str1
          str2
  
      Returns:
          Similarity between ``str1`` and ``str2`` in the interval [0.0, 1.0],
          where larger values correspond to more similar strings
      """
      shortcut = _shortcut(str1, str2)
      if shortcut:
          return shortcut
  
      distance = _hamming(str1, str2)
      max_len = max(len(str1), len(str2))
      try:
          return 1.0 - (distance / max_len)
      except ZeroDivisionError:
          return 0.0
  
file_path: textacy/src/textacy/similarity/edits.py
imports: from __future__ import annotations
  from typing import Optional
  import sklearn.feature_extraction
  import sklearn.metrics
  from jellyfish import hamming_distance
  from jellyfish import jaro_similarity
  from jellyfish import levenshtein_distance
  from ..None import constants
label_desc: Use image node_id 2 for calling a global function with example usage: hamming(str1, str2) and returns: shortcut, unknown, int