code: def first_diff(a, b):
      """
      Returns the position of the first differing character in the sequences a
      and b. For example, first_diff('render', 'rending') == 4. This function
      limits the return value to 255 so the difference can be encoded in a single
      byte.
      """
  
      i = 0
      while i <= 255 and i < len(a) and i < len(b) and a[i] == b[i]:
          i += 1
      return i
  
file_path: whoosh/src/whoosh/util/text.py
imports: import codecs, re
  from whoosh.compat import string_type, u, byte
label_desc: Use image node_id 1 for calling a global function with example usage: first_diff(a, b) and returns: i