예제 #1
0
def DecodeBase58Check(psz):
    """Decodes a Base58-encoded string and verifies its checksum."""
    vchRet = b58decode(psz, None)
    key = vchRet[0:-4]
    csum = vchRet[-4:]
    hash = base58_hash(key)
    cs32 = hash[0:4]
    if cs32 != csum:
        return None
    else:
        return key
예제 #2
0
def DecodeBase58Check(psz):
    """Decodes a Base58-encoded string and verifies its checksum."""
    vchRet = b58decode(psz, None)
    key = vchRet[0:-4]
    csum = vchRet[-4:]
    hash = base58_hash(key)
    cs32 = hash[0:4]
    if cs32 != csum:
        return None
    else:
        return key
예제 #3
0
def EncodeBase58Check(vchIn):
    """Encodes a string of bytes in Base58 encoding with a checksum."""
    hash = base58_hash(vchIn)
    return b58encode(vchIn + hash[0:4])
예제 #4
0
def hash_160_to_bc_address(h160, addrtype = 0):
    vh160 = chr(addrtype) + h160
    h = base58_hash(vh160)
    addr = vh160 + h[0:4]
    return b58encode(addr)
예제 #5
0
def EncodeBase58Check(vchIn):
    """Encodes a string of bytes in Base58 encoding with a checksum."""
    hash = base58_hash(vchIn)
    return b58encode(vchIn + hash[0:4])
예제 #6
0
def hash_160_to_bc_address(h160, addrtype=0):
    vh160 = chr(addrtype) + h160
    h = base58_hash(vh160)
    addr = vh160 + h[0:4]
    return b58encode(addr)