tron-scanner-app/src/main/kotlin/co/nilin/opex/chainscanner/tron/utils/Base58Check.java
// Directly converts to Base58Check without adding a checksum.
Directly converts to Base58Check without adding a checksum.
Directly converts to Base58Check without adding a checksum .
static String rawBytesToBase58(byte[] data) {
        StringBuilder sb = new StringBuilder();
        BigInteger num = new BigInteger(1, data);
        while (num.signum() != 0) {
            BigInteger[] quotrem = num.divideAndRemainder(ALPHABET_SIZE);
            sb.append(ALPHABET.charAt(quotrem[1].intValue()));
            num = quotrem[0];
        }
        for (int i = 0; i < data.length && data[i] == 0; i++) sb.append(ALPHABET.charAt(0));
        return sb.reverse().toString();
    }
static String rawBytesToBase58 ( byte [ ] data ) { StringBuilder sb = new StringBuilder ( ) ; BigInteger num = new BigInteger ( 1 , data ) ; while ( num . signum ( ) != 0 ) { BigInteger [ ] quotrem = num . divideAndRemainder ( ALPHABET_SIZE ) ; sb . append ( ALPHABET . charAt ( quotrem [ 1 ] . intValue ( ) ) ) ; num = quotrem [ 0 ] ; } for ( int i = 0 ; i < data . length && data [ i ] == 0 ; i ++ ) sb . append ( ALPHABET . charAt ( 0 ) ) ; return sb . reverse ( ) . toString ( ) ; }
Directly converts to Base58Check without adding a checksum.
Directly converts to Base58Check without adding a checksum .
// Convert to base-58 string // Add '1' characters for leading 0-value bytes