Here you can find the source of longTo36Str(String str)
public static String longTo36Str(String str)
//package com.java2s; //License from project: Open Source License public class Main { public static String longTo36Str(String str) { StringBuilder sb = new StringBuilder(10); int size = str.length() / 2 * 2; int mod = str.length() % 2; if (size > 0) { for (int i = 0; i < size; i = i + 2) { int a = Integer.valueOf(str.substring(i, i + 2)); sb.append(Integer.toString(a, 36)); }// w w w .j a va 2 s.c o m } if (mod > 0) { sb.append(str.substring(str.length() - 1)); } return sb.toString(); } public static String longTo36Str(long num) { String str = Long.toString(num); return longTo36Str(str); } }