MCPcopy Create free account
hub / github.com/ccxt/ccxt / base58_to_binary

Method base58_to_binary

python/ccxt/base/exchange.py:1939–1951  ·  view source on GitHub ↗

encodes a base58 string to as a big endian integer

(s)

Source from the content-addressed store, hash-verified

1937
1938 @staticmethod
1939 def base58_to_binary(s):
1940 """encodes a base58 string to as a big endian integer"""
1941 if Exchange.base58_decoder is None:
1942 Exchange.base58_decoder = {}
1943 Exchange.base58_encoder = {}
1944 for i, c in enumerate(Exchange.base58_alphabet):
1945 Exchange.base58_decoder[c] = i
1946 Exchange.base58_encoder[i] = c
1947 result = 0
1948 for i in range(len(s)):
1949 result *= 58
1950 result += Exchange.base58_decoder[s[i]]
1951 return result.to_bytes((result.bit_length() + 7) // 8, 'big')
1952
1953 @staticmethod
1954 def binary_to_base58(b):

Callers 9

test_base58_to_binaryFunction · 0.95
sign_messageMethod · 0.80
signMethod · 0.80
signMethod · 0.80
sign_messageMethod · 0.80
signMethod · 0.80
signMethod · 0.80
authenticateMethod · 0.80
authenticateMethod · 0.80

Calls 2

rangeFunction · 0.50
to_bytesMethod · 0.45

Tested by 1

test_base58_to_binaryFunction · 0.76