def b1282int(st):
 e = 1
 i = 0
 for char in iterbytes(st):
  n = ord(char)
  i += (n * e)
  e <<= 7
 return i

def b1282int ( st ) : e = 1 i = 0 for char in iterbytes ( st ) : n = ord ( char ) i += ( n * e ) e <<= 7 return i
convert an integer represented as a base 128 string into an c{int} or c{long} .