词条 | Base32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
释义 |
Base32 is one of several base 32 transfer encodings. Base32 uses a 32-character set comprising the twenty-six upper-case letters A–Z, and the digits 2–7. Base32 is primarily used to encode binary data, but Base32 is also able to encode binary text like ASCII. SoftwareBase32 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers. Base32 consists of a symbol set made up of 32 different characters, as well as an algorithm for encoding arbitrary sequences of 8-bit bytes into the Base32 alphabet. Because more than one 5-bit Base32 symbol is needed to represent each 8-bit input byte, it also specifies requirements on the allowed lengths of Base32 strings (which must be multiples of 40 bits). The closely related Base64 system, in contrast, uses a set of 64 symbols. Base32 implementations in C/C++,[1] Perl,[2] Java,[3], JavaScript[4] Python[5] and Ruby[6] are available. AdvantagesBase32 has a number of advantages over Base64:
Base32 also has advantages over hexadecimal/Base16:
DisadvantagesBase32 representation takes roughly 20% more space than Base64. Also, because it encodes 5 bytes to 8 characters (rather than 3 bytes to 4 characters), padding to an 8-character boundary is a greater burden on short messages.
RFC 4648 Base32 alphabetThe most widely used Base32 alphabet is defined in {{IETF RFC|4648}}. It uses an alphabet of A–Z, followed by 2–7. 0 and 1 are skipped due to their similarity with the letters O and I (thus "2" actually has a decimal value of 26). In some circumstances padding is not required or used (the padding can be inferred from the length of the string modulo 8). RFC 4648 states that padding must be used unless the specification of the standard referring to the RFC explicitly states otherwise. Excluding padding is useful when using base32 encoded data in URL tokens or file names where the padding character could pose a problem.
Alternative versionsChanging the Base32 alphabet, all alternative standards have similar combinations of alphanumeric symbols. z-base-32z-base-32[7] is a Base32 encoding designed to be easier for human use and more compact. It includes 1, 8 and 9 but excludes l, v and 2. It also permutes the alphabet so that the easier characters are the ones that occur more frequently. It compactly encodes bitstrings whose length in bits is not a multiple of 8, and omits trailing padding characters. z-base-32 was used in the Mnet open source project, and is currently used in Phil Zimmermann's ZRTP protocol, and in the Tahoe-LAFS open source project.
Crockford's Base32Another alternative design for Base32 is created by Douglas Crockford, who proposes using additional characters for a checksum.[8] It excludes the letters I, L, and O to avoid confusion with digits. It also excludes the letter U to reduce the likelihood of accidental obscenity. Libraries to encode binary data in Crockford's Base32 are available in a variety of languages.
ElectrologicaAn 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). base32hexTriacontakaidecimal is another alternative design for Base 32, which extends hexadecimal in a more natural way and was first proposed by Christian Lanctot, a programmer working at Sage software, in a letter to Dr. Dobb's magazine in March 1999[9] as a proposed solution for solving the Y2K bug and referred to as "Double Hex". This version was described in {{IETF RFC|2938}} under the name "Base-32". RFC 4648, while acknowledging existing use of this version in NSEC3, refers to it as base32hex and discourages labelling it as "base32". Similarly to hexadecimal, the digits used are 0-9 followed by consecutive letters of the alphabet. This matches the digits used by the JavaScript Unlike many other base 32 notation systems, triacontakaidecimal is contiguous and includes characters that may visually conflict. With the right font it is possible to visually distinguish between 0, O and 1, I. Other fonts are unsuitable because the context that English usually provides is not provided by a notation system that is expressing numbers. However, the choice of font is not controlled by notation or encoding which is why it's risky to assume a distinguishable font will be used.
GeohashSee Geohash algorithm, used to represent latitude and longitude values in one (bit-interlaced) positive integer. The base32 representation of Geohash use all decimal digits (0-9) and almost lower case alphabet, except letters "a", "i", "l", "o", as showed by the following character map:
Video gamesBefore NVRAM became universal, several video games for Nintendo platforms used base 32 numbers for passwords. These systems, like Natural Area Code, omit vowels to prevent the game from accidentally giving a profane password. Thus, the characters are generally some minor variation of the following set: 0–9, B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z, and some punctuation marks. Games known to use such a system include Mario Is Missing!, Mario's Time Machine, Tetris Blast, and The Lord of the Rings (Super NES). See also
References1. ^http://sourceforge.net/projects/cyoencode/ 2. ^{{cite web|url=https://metacpan.org/release/MIME-Base32|title=MIME-Base32 - Base32 encoder and decoder|accessdate=2018-07-29|website=MetaCPAN}} 3. ^https://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/binary/Base32.html 4. ^https://www.npmjs.com/package/base32 5. ^https://docs.python.org/3/library/base64.html 6. ^https://rubygems.org/gems/base32 7. ^{{cite web |url=http://philzimmermann.com/docs/human-oriented-base-32-encoding.txt |title=Human-oriented base-32 encoding |last=O'Whielacronx |first=Zooko |authorlink=Zooko Wilcox-O'Hearn |date=2009}} 8. ^http://www.crockford.com/wrmg/base32.html 9. ^{{cite news | url=http://www.drdobbs.com/letters/184410894 | title=A Better Date? (second letter under that heading) - Letters | work=Dr Dobb's | date=1999-03-01 | author=Lanctot, Christian}} 10. ^{{cite web | url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt | title=parseInt() - JavaScript | publisher=Mozilla | work=MDN Web Docs}} 11. ^{{cite web | url=https://docs.python.org/3/library/functions.html#int | title=Built-in Functions | publisher=Python Software Foundation | work=Python documentation}} 12. ^{{cite web |url=https://tools.ietf.org/html/rfc4648#ref-7 |title=7. Base 32 Encoding with Extended Hex Alphabet |work=RFC 4648: The Base16, Base32, and Base64 Data Encodings |publisher=IETF | year=2006 | author=Josefsson, Simon}}
1 : Binary-to-text encoding formats |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。