oss_server/explorer/blocktools/base58.py
def b58encode(v):
    """Encode v, which is a string of bytes, to base58."""

    long_value = 0L
    for (i, c) in enumerate(v[::-1]):
        long_value += ord(c) << (8 * i)  # 2x speedup vs. exponentiation

    result = ''
    while long_value >= __b58base:
        div, mod = divmod(long_value, __b58base)
        result = __b58chars[mod] + result
        long_value = div
    result = __b58chars[long_value] + result

    # Bitcoin does a little leading-zero-compression:
    # leading 0-bytes in the input become leading-1s
    nPad = 0
    for c in v:
        if c == '\0':
            nPad += 1
        else:
            break

    return (__b58chars[0] * nPad) + result
Encode v, which is a string of bytes, to base58.
Encode v, which is a string of bytes, to base58.
Encode v which is a string of bytes to base58 .
def b58encode(v):
    long_value = 0L
    for (i, c) in enumerate(v[::-1]):
        long_value += ord(c) << (8 * i)  
    result = ''
    while long_value >= __b58base:
        div, mod = divmod(long_value, __b58base)
        result = __b58chars[mod] + result
        long_value = div
    result = __b58chars[long_value] + result
    nPad = 0
    for c in v:
        if c == '\0':
            nPad += 1
        else:
            break
    return (__b58chars[0] * nPad) + result
def b58encode ( v ) : long_value = 0L for ( i , c ) in enumerate ( v [ : : - 1 ] ) : long_value += ord ( c ) << ( 8 * i ) result = '' while long_value >= __b58base : div , mod = divmod ( long_value , __b58base ) result = __b58chars [ mod ] + result long_value = div result = __b58chars [ long_value ] + result nPad = 0 for c in v : if c == '\0' : nPad += 1 else : break return ( __b58chars [ 0 ] * nPad ) + result
Encode v, which is a string of bytes, to base58.
Encode v which is a string of bytes to base58 .
"""Encode v, which is a string of bytes, to base58.""" # 2x speedup vs. exponentiation # Bitcoin does a little leading-zero-compression: # leading 0-bytes in the input become leading-1s
v