ParticipantIDParser { protected static String shorten(BigInteger number) { StringBuilder builder = new StringBuilder(); int url; do { url = number.mod(new BigInteger("36")).intValue(); number = number.divide(new BigInteger("36")); builder.append(alphabet.charAt(url)); } while (number.compareTo(BigInteger.ZERO) > 0); return builder.toString(); }  static String encode(String raw); static String decode(String encoded); static String[] parseId(String raw); static String getIpAddress(String encoded); static String[] parseEncodedId(String encodedId); static boolean isCall(RemoteParticipant participant); static boolean isMixer(RemoteParticipant participant); static void main(String[] args); static Pattern pattern; }
@Test public void testShorten() { assertEquals(new BigInteger("1"), ParticipantIDParser.unshort(ParticipantIDParser.shorten(new BigInteger("1")))); assertEquals(new BigInteger("23"), ParticipantIDParser.unshort(ParticipantIDParser.shorten(new BigInteger("23")))); assertEquals(new BigInteger("234"), ParticipantIDParser.unshort(ParticipantIDParser.shorten(new BigInteger("234")))); assertEquals(new BigInteger("45234"), ParticipantIDParser.unshort(ParticipantIDParser.shorten(new BigInteger("45234")))); assertEquals(new BigInteger("98045234"), ParticipantIDParser.unshort(ParticipantIDParser.shorten(new BigInteger("98045234")))); assertEquals(new BigInteger("25698045234"), ParticipantIDParser.unshort(ParticipantIDParser.shorten(new BigInteger("25698045234")))); }