Base32

Uses your system voice; voice and rate in settings.

Snapshot

≈ 5 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

Base32 is binary-to-text encoding based on the base-32 numeral system. It uses an alphabet of 32 digits, each of which represents a different combination of 5 bits (2 5 ). Since base32 is not very widely adopted, the question of notation i.e. which characters to use to represent the 32 digits is not as settled as in the case of more well-known numeral systems (such as hexadecimal) even though RFCs and unofficial and de facto standards exist. One way to represent Base32 numbers in human-readable form is using digits 0–9 followed by the twenty-two upper-case letters A–V. However, many other variations are used in different contexts. Historically, Baudot code could be considered a modified (stateful) base32 code. Base32 is often used to represent byte strings.

Base32 is binary-to-text encoding based on the base-32 numeral system. It uses an alphabet of 32 digits, each of which represents a different combination of 5 bits (2 5 ). Since base32 is not very widely adopted, the question of notation i.e. which characters to use to represent the 32 digits is not as settled as in the case of more well-known numeral systems (such as hexadecimal) even though RFCs and unofficial and de facto standards exist. One way to represent Base32 numbers in human-readable form is using digits 0–9 followed by the twenty-two upper-case letters A–V. However, many other variations are used in different contexts. Historically, Baudot code could be considered a modified (stateful) base32 code. Base32 is often used to represent byte strings. === Base 32 Encoding with Extended Hex Alphabet per §7 === "Extended hex" base 32 or base32hex, another scheme for base 32 per RFC 4648 §7, extends hexadecimal in a more natural way: Its lower half is identical with hexadecimal, and beyond that, base32hex simply continues the alphabet through to the letter V. This scheme was first proposed by Christian Lanctot, a programmer working at Sage software, in a letter to Dr. Dobb's magazine in March 1999 as part of a suggested solution for the Y2K bug. Lanctot referred to it as "Double Hex". The same alphabet was described in 2000 in under the name "Base-32". RFC 4648, while acknowledging existing use of this version in NSEC3, refers to it as base32hex and discourages referring to it as only "base32". Since this notation uses digits 0–9 followed by consecutive letters of the alphabet, it matches the digits used by the JavaScript parseInt() function and the Python int() constructor when a base larger than 10 (such as 16 or 32) is specified. It also retains hexadecimal's property of preserving bitwise sort order of the represented data, unlike RFC 4648's §6 base32, or base64. Unlike many other base 32 notation systems, base32hex digits beyond 9 are contiguous. However, its set of digits includes characters that may visually conflict. With many fonts it is possible to visually distinguish between similar looking characters like (0, O) and (1, I), but in other fonts this may be difficult and thus they may be unsuitable for rendering base32 character sequences. This is especially true in a notation system that is only expressing numbers, when the context English usually provides is not present. The choice of font is controlled by neither notation nor encoding, yet base32hex makes no attempt to compensate for the shortcomings of affected fonts. An earlier form of base 32 notation was used by programmers working on the Electrologica X1 to represent machine addresses. The "digits" were represented as decimal numbers from 0 to 31. For example, 12-16 would represent the machine address 400 (= 12 × 32 + 16). ==Comparisons with other systems== Even if Base32 takes roughly 20% less space than hexadecimal, Base32 is much less used. Hexadecimal can easily be mapped to bytes because two hexadecimal digits is a byte. Base32 does not map to individual bytes. However, two Base32 digits correspond to ten bits, which can encode (32 × 32 =) 1,024 values, with obvious applications for orders of magnitude of multiple-byte units in terms of powers of 1,024. Hexadecimal is easier to learn and remember, since that only entails memorising the numerical values of six additional symbols (A–F), and even if those are not instantly recalled, it is easier to count through just over a handful of values. ==Software implementations == Base32 programs are suitable for encoding arbitrary byte data using a restricted set of symbols that can both be conveniently used by humans and processed by computers. Base32 implementations use a symbol set made up of at least 32 different characters (sometimes a 33rd for padding), as well as an algorithm for encoding arbitrary sequences of 8-bit bytes into a Base32 alphabet. Because more than one 5-bit Base32 character is needed to represent each 8-bit input byte, if the input is not a multiple of 5 bytes (40 bits), then it doesn't fit exactly in 5-bit Base32 characters. In that case, some specifications require padding characters to be added while some require extra zero bits to make a multiple of 5 bits. The closely related Base64 system, in contrast, uses a set of 64 symbols (or 65 symbols when padding is used). Base32 implementations in C/C++, Perl, Java, JavaScript, Python, Go and Ruby are available. ==See also== Base16 Encoding for a sequence of byte values using hexadecimal representation Ngiti language — utilizes a base-32 numeral system ==Notes== ==References==

Text derived from https://en.wikipedia.org/w/index.php?oldid=1371823633 under CC BY-SA 4.0; modifications have been made.