def b58encode(value):
 encoded = ''
 while (value >= __b58base):
  (div, mod) = divmod(value, __b58base)
  encoded = (__b58chars[mod] + encoded)
  value = div
 encoded = (__b58chars[value] + encoded)
 return encoded

def b58encode ( value ) : encoded = '' while ( value >= __b58base ) : ( div , mod ) = divmod ( value , __b58base ) encoded = ( __b58chars [ mod ] + encoded ) value = div encoded = ( __b58chars [ value ] + encoded ) return encoded
encode v .