Here you can find the source of encodeToBase62(BigInteger num)
public static String encodeToBase62(BigInteger num)
//package com.java2s; //License from project: Open Source License import java.math.BigInteger; public class Main { private static final String BASE62_DIGITS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; private static final BigInteger SIXTY_TWO = new BigInteger("62"); public static String encodeToBase62(byte[] bytes) { BigInteger value = new BigInteger(bytes); return encodeToBase62(value); }/*from w w w.j av a2 s .c om*/ public static String encodeToBase62(BigInteger num) { BigInteger value = BigInteger.ZERO.add(num); String result = ""; while (!value.equals(BigInteger.ZERO)) { result = BASE62_DIGITS.charAt(value.mod(SIXTY_TWO).intValue()) + result; value = value.divide(SIXTY_TWO); } return result; } }