parameters: (self, i, default_one=True)
return_statement: return string, sum_chk % self.base
docstring: Encode an integer using BaseX
docstring_summary: Encode an integer using BaseX
docstring_tokens: Encode an integer using BaseX
function: def encode_int(self, i, default_one=True):
          """Encode an integer using BaseX"""
          if not i and default_one:
              return self.alphabet[0]
  
          string = ""
          sum_chk = 0
          while i:
              i, idx = divmod(i, self.base)
              string = self.alphabet[idx] + string
              sum_chk += idx
  
          sumsz = len(string)
          sum_chk += sumsz + sumsz / self.base
  
          return string, sum_chk % self.base
function_tokens: def encode_int ( self , i , default_one = True ) : if not i and default_one : return self . alphabet [ 0 ] string = "" sum_chk = 0 while i : i , idx = divmod ( i , self . base ) string = self . alphabet [ idx ] + string sum_chk += idx sumsz = len ( string ) sum_chk += sumsz + sumsz / self . base return string , sum_chk % self . base