Here you can find the source of longToBase36(long decimalNumber)
Parameter | Description |
---|---|
decimalNumber | a parameter |
public static String longToBase36(long decimalNumber)
//package com.java2s; //License from project: Open Source License public class Main { private static final String DIGITS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; /**/*from w w w.j a v a 2 s . c o m*/ * Converts a long to base 36. * @param decimalNumber * @return */ public static String longToBase36(long decimalNumber) { long base = 36; String tempVal = decimalNumber == 0 ? "0" : ""; int mod = 0; while (decimalNumber != 0) { long m = decimalNumber % base; mod = (int) m; tempVal = DIGITS.substring(mod, mod + 1) + tempVal; decimalNumber = decimalNumber / base; } return tempVal; } }