@Test public void test() throws Exception { BENCHMARK.doSomething("code1:", () -> IdCodeUtils.toCode(Long.MAX_VALUE)); }
public static String toCode(long id) { char[] buf = new char[13]; int index = buf.length - 1; while (id >= CODE_CHARS_LENGTH) { buf[index--] = CHARS[(int) (id % CODE_CHARS_LENGTH)]; id >>>= 5; } buf[index] = CHARS[(int) (id)]; return new String(buf, index, (buf.length - index)); }
IdCodeUtils { public static String toCode(long id) { char[] buf = new char[13]; int index = buf.length - 1; while (id >= CODE_CHARS_LENGTH) { buf[index--] = CHARS[(int) (id % CODE_CHARS_LENGTH)]; id >>>= 5; } buf[index] = CHARS[(int) (id)]; return new String(buf, index, (buf.length - index)); } }
IdCodeUtils { public static String toCode(long id) { char[] buf = new char[13]; int index = buf.length - 1; while (id >= CODE_CHARS_LENGTH) { buf[index--] = CHARS[(int) (id % CODE_CHARS_LENGTH)]; id >>>= 5; } buf[index] = CHARS[(int) (id)]; return new String(buf, index, (buf.length - index)); }  }
IdCodeUtils { public static String toCode(long id) { char[] buf = new char[13]; int index = buf.length - 1; while (id >= CODE_CHARS_LENGTH) { buf[index--] = CHARS[(int) (id % CODE_CHARS_LENGTH)]; id >>>= 5; } buf[index] = CHARS[(int) (id)]; return new String(buf, index, (buf.length - index)); }  static String toCode(long id); static long toLong(String code); }
IdCodeUtils { public static String toCode(long id) { char[] buf = new char[13]; int index = buf.length - 1; while (id >= CODE_CHARS_LENGTH) { buf[index--] = CHARS[(int) (id % CODE_CHARS_LENGTH)]; id >>>= 5; } buf[index] = CHARS[(int) (id)]; return new String(buf, index, (buf.length - index)); }  static String toCode(long id); static long toLong(String code);  }