code: public static String toBase58(byte[] b) {
          if (b.length == 0) {
              return "";
          }
  
          int lz = 0;
          while (lz < b.length && b[lz] == 0) {
              ++lz;
          }
  
          StringBuilder s = new StringBuilder();
          BigInteger n = new BigInteger(1, b);
          while (n.compareTo(BigInteger.ZERO) > 0) {
              BigInteger[] r = n.divideAndRemainder(BigInteger.valueOf(58));
              n = r[0];
              char digit = b58[r[1].intValue()];
              s.append(digit);
          }
          while (lz > 0) {
              --lz;
              s.append("1");
          }
          return s.reverse().toString();
      }
docs: convert a byte array to a human readable base58 string. Base58 is a Bitcoin
  specific encoding similar to widely used base64 but avoids using characters
  of similar shape, such as 1 and l or O an 0
  
  @param b
  byte data
  @return base58 data