MCPcopy Index your code
hub / github.com/jimmysong/programmingbitcoin / address

Method address

code-ch08/ecc.py:423–430  ·  view source on GitHub ↗

Returns the address string

(self, compressed=True, testnet=False)

Source from the content-addressed store, hash-verified

421 return hash160(self.sec(compressed))
422
423 def address(self, compressed=True, testnet=False):
424 '''Returns the address string'''
425 h160 = self.hash160(compressed)
426 if testnet:
427 prefix = b'\x6f'
428 else:
429 prefix = b'\x00'
430 return encode_base58_checksum(prefix + h160)
431
432 @classmethod
433 def parse(self, sec_bin):

Callers 1

test_addressMethod · 0.45

Calls 2

hash160Method · 0.95
encode_base58_checksumFunction · 0.90

Tested by 1

test_addressMethod · 0.36