parameters: (v)
return_statement: return (alphabet[0:1] * nPad + result)
docstring: Encode a string using Base58
docstring_summary: Encode a string using Base58
docstring_tokens: Encode a string using Base58
function: def b58encode(v):
      '''Encode a string using Base58'''
  
      v = scrub_input(v)
  
      nPad = len(v)
      v = v.lstrip(b'\0')
      nPad -= len(v)
  
      p, acc = 1, 0
      for c in iseq(reversed(v)):
          acc += p * c
          p = p << 8
  
      result = b58encode_int(acc, default_one=False)
  
      return (alphabet[0:1] * nPad + result)
function_tokens: def b58encode ( v ) : v = scrub_input ( v ) nPad = len ( v ) v = v . lstrip ( b'\0' ) nPad -= len ( v ) p , acc = 1 , 0 for c in iseq ( reversed ( v ) ) : acc += p * c p = p << 8 result = b58encode_int ( acc , default_one = False ) return ( alphabet [ 0 : 1 ] * nPad + result )