code: public static String encode(byte[] data) {
          if (data.length == 0) {
              return "";
          }
          final byte[] bytes = copyOfRange(data, 0, data.length);
          // Count leading zeroes.
          int zeroCount = 0;
          while (zeroCount < bytes.length && bytes[zeroCount] == 0) {
              ++zeroCount;
          }
          // The actual encoding.
          byte[] temp = new byte[bytes.length * 2];
          int j = temp.length;
  
          int startAt = zeroCount;
          while (startAt < bytes.length) {
              byte mod = divmod58(bytes, startAt);
              if (bytes[startAt] == 0) {
                  ++startAt;
              }
              temp[--j] = (byte) ALPHABET[mod];
          }
  
          // Strip extra '1' if there are some after decoding.
          while (j < temp.length && temp[j] == ALPHABET[0]) {
              ++j;
          }
          // Add as many leading '1' as there were leading zeros.
          while (--zeroCount >= 0) {
              temp[--j] = (byte) ALPHABET[0];
          }
  
          byte[] output = copyOfRange(temp, j, temp.length);
          try {
              return new String(output, "US-ASCII");
          } catch (UnsupportedEncodingException e) {
              throw new ApplicationException(e);  // Cannot happen.
          }
      }
docs: Encodes the given bytes in base58. No checksum is appended.
  
  @param data to encode
  @return base58 encoded input