Exemplo n.º 1
0
def key_to_address(s, version=0):
    s = chr(version) + s
    checksum = dhash(s)[:4]
    encoded = base58_encode(int((s + checksum).encode('hex'), 16))
    pad = 0
    for c in s:
        if c == '\x00':
            pad += 1
        else:
            break
    return ('1' * pad) + encoded
Exemplo n.º 2
0
def key_to_address (s, version=0):
    s = chr(version) + s
    checksum = dhash (s)[:4]
    encoded = base58_encode (
        int ((s + checksum).encode ('hex'), 16)
    )
    pad = 0
    for c in s:
        if c == '\x00':
            pad += 1
        else:
            break
    return ('1' * pad) + encoded
Exemplo n.º 3
0
def pkey_to_address (s):
    s = '\x80' + s
    checksum = dhash (s)[:4]
    return base58_encode (
        int ((s + checksum).encode ('hex'), 16)
        )
Exemplo n.º 4
0
def key_to_address (s):
    checksum = dhash ('\x00' + s)[:4]
    return '1' + base58_encode (
        int ('0x' + (s + checksum).encode ('hex'), 16)
        )
Exemplo n.º 5
0
def pkey_to_address(s):
    s = '\x80' + s
    checksum = dhash(s)[:4]
    return base58_encode(int((s + checksum).encode('hex'), 16))
Exemplo n.º 6
0
def key_to_address(s):
    checksum = dhash('\x00' + s)[:4]
    return '1' + base58_encode(int('0x' + (s + checksum).encode('hex'), 16))