def decodeBase58(string, alphabet=ALPHABET):
 base = len(alphabet)
 num = 0
 try:
  for char in string:
   num *= base
   num += alphabet.index(char)
 except:
  return 0
 return num

def decodeBase58 ( string , alphabet = ALPHABET ) : base = len ( alphabet ) num = 0 try : for char in string : num *= base num += alphabet . index ( char ) except : return 0 return num
decode a base x encoded string into the number arguments: - string: the encoded string - alphabet: the alphabet to use for encoding .