def get_address(self, hrp, ver): """Return bech32 compressed address""" return bech2address(hrp, ver, self.identifier())
def bin2addr(b, hrp): ver, identifier = b[0], b[1:] return bech2address(hrp, ver, identifier)
def convert_address(ck, hrp, ver): """convert address's version""" n_hrp, n_ver, n_id = address2bech(ck) return bech2address(hrp, ver, n_id)
def dummy_address(dummy_identifier): assert len(dummy_identifier) == 20 return bech2address('dummy', 0, dummy_identifier)
def get_address(pk, hrp, ver): """get address from public key""" identifier = hashlib.new('ripemd160', hashlib.sha256(pk).digest()).digest() return bech2address(hrp, ver, identifier)