def b58check_encode(bin_s, version_byte=0):
    # append the version byte to the beginning
    bin_s = chr(int(version_byte)) + bin_s
    # calculate the number of leading zeros
    num_leading_zeros = len(re.match(r'^\x00*', bin_s).group(0))
    # add in the checksum add the end
    bin_s = bin_s + bin_checksum(bin_s)
    # convert from b2 to b16
    hex_s = hexlify(bin_s)
    # convert from b16 to b58
    b58_s = change_charset(hex_s, HEX_KEYSPACE, B58_KEYSPACE)

    return B58_KEYSPACE[0] * num_leading_zeros + b58_s
Low level record iteration.
dataset/ETHPy150Open blockstack/pybitcoin/pybitcoin/b58check.py/b58check_encode--crossover with--dataset/ETHPy150Open lektor/lektor/lektor/db.py/EmptyQuery._iterate