Skip to content

Commit 7ae1d0f

Browse files
committed
Rename b58_digits -> B58_DIGITS
Is a constant [ yapified by gitreformat (github/ghtdak) on Mon Nov 30 21:11:22 2015 ]
1 parent 7d3c7fe commit 7ae1d0f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

bitcoin/base58.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
import bitcoin.core
2727

28-
b58_digits = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
28+
B58_DIGITS = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
2929

3030

3131
class Base58Error(Exception):
@@ -50,7 +50,7 @@ def encode(b):
5050
res = []
5151
while n > 0:
5252
n, r = divmod(n, 58)
53-
res.append(b58_digits[r])
53+
res.append(B58_DIGITS[r])
5454
res = ''.join(res[::-1])
5555

5656
# Encode leading zeros as base58 zeros
@@ -64,7 +64,7 @@ def encode(b):
6464
pad += 1
6565
else:
6666
break
67-
return b58_digits[0] * pad + res
67+
return B58_DIGITS[0] * pad + res
6868

6969

7070
def decode(s):
@@ -76,10 +76,10 @@ def decode(s):
7676
n = 0
7777
for c in s:
7878
n *= 58
79-
if c not in b58_digits:
79+
if c not in B58_DIGITS:
8080
raise InvalidBase58Error(
8181
'Character %r is not a valid base58 character' % c)
82-
digit = b58_digits.index(c)
82+
digit = B58_DIGITS.index(c)
8383
n += digit
8484

8585
# Convert the integer to bytes
@@ -91,7 +91,7 @@ def decode(s):
9191
# Add padding back.
9292
pad = 0
9393
for c in s[:-1]:
94-
if c == b58_digits[0]: pad += 1
94+
if c == B58_DIGITS[0]: pad += 1
9595
else: break
9696
return b'\x00' * pad + res
9797

0 commit comments

Comments
 (0)