File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 2525
2626import bitcoin .core
2727
28- b58_digits = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
28+ B58_DIGITS = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
2929
3030
3131class 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
7070def 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
You can’t perform that action at this time.
0 commit comments