Base36
Base36 is a binary-to-text encoding that represents binary data in an ASCII string format by translating it into a radix-36 representation. The choice of 36 is convenient in that the digits can be represented using the numerals 0–9 and the letters a-z.
Each base36 digit needs less than 6 bits of information to be represented.
Conversion
Signed 32- and 64-bit integers will only hold at most 6 or 13 base-36 digits, respectively. For example, the 64-bit signed integer maximum value of "9223372036854775807" is "" in base-36.Similarly, the 32-bit signed integer maximum value of "2147483647" is "" in base-36.
Standard implementations
The C [standard library] since C89 supports base36 numbers via the strtol and strtoul functionsIn the Common Lisp standard, functions like
parse-integer support a radix of 2 to 36.Java SE supports conversion from/to String to different bases from 2 up to 36. For example, and
Just like Java, JavaScript also supports conversion from/to String to different bases from 2 up to 36.
PHP, like Java, supports conversion from/to String to different bases from 2 up to 36 using the function, available since PHP 4.
Go supports conversion to string to different bases from 2 up to 36 using the built-in
strconv.FormatInt, and strconv.FormatUint functions, and conversions from string encoded in different bases from 2 up to 36 using the built-in strconv.ParseInt, and strconv.ParseUint functions.Python allows conversions of strings from base 2 to base 36.
Raku supports base2 to base36 for all its real numeric types with its builtins:
base and parse-base.