- An arbitrary sequence of octets can be represented.
- An encoding can be included in a URI without character escaping.
- The encoding does not depend on case being preserved.
- The encoding is compact.
- Encoding and decoding are fast.
The base32 encoding is designed to represent arbitrary sequences of octets in a form that is suitable for inclusion in a URI or filename.
Each 5 bits of input is encoded as a character from the alphabet:
The encoded data may be a cryptographic hash or a nonce.
The purpose of this encoding is to include octet sequences in a URI. The encoding
alphabet is restricted to the
In some situations, the transport does not guarantee that case will be preserved during transmission. For example, case is not preserved with DNS names and filenames in some filesystems. Non-compliant SMTP software may also fail to preserve case in mailbox names.
A URI or filename is easier to use when it is short.
Encoding/decoding time will often be included in the latency of lookup operations.
A 32-character subset of US-ASCII is used, enabling 5 bits to be represented per printable character.
Octets are encoded from first to last, with each octet being processed in big-endian bit order. This binary stream is processed in 5 bit groups, each of which is translated into a single character in the base32 alphabet. Each 5-bit group is used as an index into an array of 32 printable characters. The character referenced by the index is placed in the output string. These characters, identified in Table 1, below, are selected from US-ASCII digits and lowercase letters.
If the length of the binary input stream is not a multiple of 5, the stream is padded with
During decoding, changes in case are ignored; however, any other character from outside of the
case-insensitive encoding alphabet is treated as an unrecoverable decoding error. The decoder MUST also
verify that the encoding represents an integral number of octets and that any padding bits are
The base32 encoding defined by this specification is derived from the base32 encoding defined by RFC 3548. [RFC 3548] The differences between the base32 encoding defined here, and that in RFC 3548 are:
Copyright 2002 - 2003 Waterken Inc. All rights reserved.