Skip to content
This repository was archived by the owner on Apr 19, 2024. It is now read-only.

Commit cd6ee9f

Browse files
committed
do not add Base58 codecs when the base58 module is missing
1 parent 0da4962 commit cd6ee9f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

multihash.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,11 @@ def reset(cls):
189189
cls._codecs = {
190190
'hex': c(ba.b2a_hex, ba.a2b_hex),
191191
'base32': c(b64.b32encode, b64.b32decode),
192-
'base58': c(lambda s: bytes(b58.b58encode(s)), b58.b58decode),
193192
'base64': c(b64.b64encode, b64.b64decode)
194193
}
194+
if b58:
195+
cls._codecs['base58'] = c(
196+
lambda s: bytes(b58.b58encode(s)), b58.b58decode)
195197

196198
@classmethod
197199
def get_encoder(cls, encoding):

0 commit comments

Comments
 (0)