code: def encode_int(self, n):
          
          str = []
          while True:
              n, r = divmod(n, self.BASE)
              str.append(self.ALPHABET[r])
              if n == 0: break
          return ''.join(reversed(str))
docs: Encodes an integer into a short Base64 string.
  
          Example:
              ``encode_int(123)`` returns ``'B7'``.