Here you can find the source of longToString(long l)
public static String longToString(long l)
//package com.java2s; //License from project: Open Source License public class Main { private static final char[] VALID_CHARS = { '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; public static String longToString(long l) { if (l <= 0L || l >= 0x5b5b57f8a98a5dd1L) { return null; }//from ww w. j av a 2s . co m if (l % 37L == 0L) { return null; } int i = 0; char ac[] = new char[12]; while (l != 0L) { long l1 = l; l /= 37L; ac[11 - i++] = VALID_CHARS[(int) (l1 - l * 37L)]; } return new String(ac, 12 - i, i); } }