code: def _to_base36(number):
      
      if number < 0:
          raise ValueError("Cannot encode negative numbers")
  
      chars = ""
      while number != 0:
          number, i = divmod(number, 36)  # 36-character alphabet
          chars = _alphabet[i] + chars
  
      return chars or "0"
docs: Convert a positive integer to a base36 string.
  
      Taken from Stack Overflow and modified.