List of utility methods to do Base Encode
String | toBase2SuffixedString(long n) to Base Suffixed String if (n > 0 && Long.bitCount(n) == 1) { int i = Long.numberOfTrailingZeros(Math.abs(n)) / 10; return (n >> (i * 10)) + BASE_2_SUFFIXES[i]; } else { int i = (63 - Long.numberOfLeadingZeros(n)) / 10; long factor = 1L << (i * 10); long leading = n / factor; long decimalFactor = factor / 10; ... |
char | toBase32Char(int i) to Base Char return BASE32_CHAR_FROM_INT[i];
|
String | toBase36(int decimalNumber) to Base return fromDecimalToOtherBase(36, decimalNumber);
|
String | toBase36(long l) to Base return Long.toString(l, 36);
|
String | toBase36(long num) Convert number to base 36 (0-9A-Z) return toBase(num, BASE36_CHARS);
|
String | toBase62(int decimalNumber) to Base return fromDecimalToOtherBase(62, decimalNumber);
|
String | toBase8(int decimalNumber) to Base return fromDecimalToOtherBase(8, decimalNumber);
|
String | toBase85String(byte[] data) to Base String StringBuffer buffer = new StringBuffer(); int count = 0; for (int i = 0; i <= data.length - 4; i += 4) { char[] base85String = toBase85String(getUnsignedInt(data, i)); buffer.append(base85String); count += base85String.length; if (count > 80) { buffer.append('\n'); ... |
String | toBase90(int i) to Base int tmp = i; StringBuilder result = new StringBuilder(); do { int y = tmp % 90; result.insert(0, base90[y]); tmp = (tmp - y) / 90; } while (tmp >= 90); result.insert(0, base90[tmp]); ... |