<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def encode_int(self, n):
 """ Encodes an integer into a short Base64 string. Example: ``encode_int(123)`` returns ``'B7'``. """

        str = []
        while True:
            n, r = divmod(n, self.BASE)
            str.append(self.ALPHABET[r])
            if n == 0: break
        return ''.join(reversed(str))