Why is there a restriction on the use of Java?

I noticed that the maximum limit for radix in Java is base 36. Is this an arbitrary limit, or is there any reason for Java to limit the base this way?

+4
source share
4 answers

This is the number of decimal digits (10), as well as the number of letters in the alphabet (26).

If radius 37 was allowed, a new character should be selected to represent the 37th digit. Although, of course, one could choose a character, there is no obvious choice. It just makes sense to ban big radixes.

+8
source

Very simple: 26 letters + 10 numbers = 36.

Traditional numbers and Latin letters are used to represent a number.

+1
source

The Radix constraint makes sense if the output should be readable. In different cases, the output should NOT be readable. Thus, a higher limit would help in such cases. And the java langage radix constraint is a weak point for java.

0
source

You can use Base64 encoding scheme as specified in RFC 4648 and RFC 2045.

Just generate a byte representation of your int number according to your needs to be compatible with most libraries that implement Base64.

0
source

Source: https://habr.com/ru/post/1380926/


All Articles