Base 62

Base62 is an encoding system that encodes large numbers using ASCII characters. The digits <code>0-9</code> (value <code>0-9</code>), uppercase letters <code>A-Z</code> (value <code>10-35</code>) and lowercase letters <code>a-z</code> (value <code>36-61</code>) are used. The high number base results in shorter character strings than with the decimal or hexadecimal system, which offers two main advantages:
* They can be entered by a human faster and with a lower risk of error. In this case, a font should be selected in which characters that could be confusing, such as a lowercase <code>l</code> and an uppercase <code>I</code> or a zero (<code>0</code>) and an uppercase <code>O</code>, are distinguishable.
* Length restrictions, for example, when a number is to be used as part of an identifier or file name, can be bypassed. However, it should be noted that the processing system is case-sensitive.
Base62 is not widely used. Although the large number base allows a high density encoding, it is not human-friendly. The use of both upper and lower case letters makes the strings awkward to read out. There is also the risk of <code>0</code>/<code>O</code> and <code>l</code>/<code>1</code> confusion. Other encodings, such as Base58, restrict the symbol alphabet further to avoid these problems. Compared to the more widely used Base64, Base62 does have the advantage that its values may be used in URLs without requiring further percent-encoding. Accordingly Base62 has mostly been used for entirely automated contexts, such as URL shortening services and passing tokens to external ad servers.
Implementation
Here some implementations in various languages.
* JavaScript: https://www.npmjs.com/package/base62
* Python: https://pypi.python.org/pypi/pybase62
* Rust: https://crates.io/crates/base62
 
< Prev   Next >