Java Utililty Methods Long to Base

List of utility methods to do Long to Base

Description

The list of methods to do Long to Base are organized into topic(s).

Method

StringlongToBase36(long decimalNumber)
Converts a long to base 36.
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;
...
StringlongToBase36(long in)
Convert a long to a lowercase base36 string
return Long.toString(in, 36).toLowerCase();
StringlongToBase64(long number)
long To Base
return Base64.getEncoder().encodeToString(longToBytes(number));