Exemple #1
0
 def get_address(self, hrp, ver):
     """Return bech32 compressed address"""
     return bech2address(hrp, ver, self.identifier())
Exemple #2
0
def bin2addr(b, hrp):
    ver, identifier = b[0], b[1:]
    return bech2address(hrp, ver, identifier)
Exemple #3
0
def convert_address(ck, hrp, ver):
    """convert address's version"""
    n_hrp, n_ver, n_id = address2bech(ck)
    return bech2address(hrp, ver, n_id)
Exemple #4
0
def dummy_address(dummy_identifier):
    assert len(dummy_identifier) == 20
    return bech2address('dummy', 0, dummy_identifier)
Exemple #5
0
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)