@Test public final void testPowersBase62() { long[] pow62 = new long[Base62Encoder.pow62.length + 1]; pow62[0] = 1; System.arraycopy(Base62Encoder.pow62, 0, pow62, 1, Base62Encoder.pow62.length); long input = 0l; assertEquals("Base 62 encoded value for " + input + " is incorrect ", "0", Base62Encoder.toString(input)); StringBuilder expectedValBuilder = new StringBuilder("1"); for (int i = 0; i < pow62.length; ++i) { input = pow62[i]; assertEquals("Base 62 encoded value for " + input + " is incorrect ", expectedValBuilder.toString(), Base62Encoder.toString(input)); assertEquals("Base 62 encoded value for " + input + " is incorrect ", "-" + expectedValBuilder.toString(), Base62Encoder.toString(-input)); expectedValBuilder.append("0"); } }
public static String toString(long num) { if (num == Long.MIN_VALUE) return "-AzL8n0Y58m8"; int size = (num < 0) ? stringSize(-num) + 1 : stringSize(num); char[] buf = new char[size]; getChars(num, size, buf); return new String(buf); }
Base62Encoder { public static String toString(long num) { if (num == Long.MIN_VALUE) return "-AzL8n0Y58m8"; int size = (num < 0) ? stringSize(-num) + 1 : stringSize(num); char[] buf = new char[size]; getChars(num, size, buf); return new String(buf); } }
Base62Encoder { public static String toString(long num) { if (num == Long.MIN_VALUE) return "-AzL8n0Y58m8"; int size = (num < 0) ? stringSize(-num) + 1 : stringSize(num); char[] buf = new char[size]; getChars(num, size, buf); return new String(buf); }  }
Base62Encoder { public static String toString(long num) { if (num == Long.MIN_VALUE) return "-AzL8n0Y58m8"; int size = (num < 0) ? stringSize(-num) + 1 : stringSize(num); char[] buf = new char[size]; getChars(num, size, buf); return new String(buf); }  static String toString(long num); }
Base62Encoder { public static String toString(long num) { if (num == Long.MIN_VALUE) return "-AzL8n0Y58m8"; int size = (num < 0) ? stringSize(-num) + 1 : stringSize(num); char[] buf = new char[size]; getChars(num, size, buf); return new String(buf); }  static String toString(long num); static final char[] digits; }