diff --git a/src/addresses.py b/src/addresses.py index b9135d04..5f666543 100644 --- a/src/addresses.py +++ b/src/addresses.py @@ -42,12 +42,14 @@ def decodeBase58(string, alphabet=ALPHABET): - `alphabet`: The alphabet to use for encoding """ base = len(alphabet) + strlen = len(string) num = 0 - + try: + power = strlen - 1 for char in string: - num *= base - num += alphabet.index(char) + num += alphabet.index(char) * (base ** power) + power -= 1 except: #character not found (like a space character or a 0) return 0 diff --git a/src/shared.py b/src/shared.py index 3f60a852..c82bf73a 100644 --- a/src/shared.py +++ b/src/shared.py @@ -1,4 +1,4 @@ -softwareVersion = '0.4.2' +softwareVersion = '0.4.3' verbose = 1 maximumAgeOfAnObjectThatIAmWillingToAccept = 216000 # Equals two days and 12 hours. lengthOfTimeToLeaveObjectsInInventory = 237600 # Equals two days and 18 hours. This should be longer than maximumAgeOfAnObjectThatIAmWillingToAccept so that we don't process messages twice.