code: def str2int(self, num):
          
          radix, alphabet = self.radix, self.alphabet
          if radix <= 36 and alphabet[:radix].lower() == BASE85[:radix].lower():
              return int(num, radix)
          ret = 0
          lalphabet = alphabet[:radix]
          for char in num:
              if char not in lalphabet:
                  raise ValueError("invalid literal for radix2int() with radix "
                                   "%d: '%s'" % (radix, num))
              ret = ret * radix + self.cached_map[char]
          return ret
docs: Converts a string into an integer.
  
          If possible, the built-in python conversion will be used for speed
          purposes.
  
          :param num: A string that will be converted to an integer.
  
          :rtype: integer
  
          :raise ValueError: when *num* is invalid