What is base32 encoding?

18,304

Solution 1

Like any other "ASCII-only" encoding, base32's primary purpose is to make sure that the data it encodes will survive transportation through systems or protocols which have special restrictions on the range of characters they will accept and emerge unmodified.

For example, b32-encoded data can be passed to a system that accepts single-byte character input, or UTF-8 encoded string input, or appended to a URL, or added to HTML content, without being mangled or resulting in an invalid form. Base64 (which is much more common) is used for the exact same reasons.

The main advantage of b32 over b64 is that it is much more human-readable. That's not much of an advantage because the data will typically be processed by computers, hence the relative rarity of b32 versus b64 (which is more efficient space-wise).

Update: there's the same question asked about Base64 here: What is base 64 encoding used for?

Solution 2

Base32 encoding (and Base64) encoding is motivated by situations where you need to encode unrestricted binary within a storage or transport system that allow only data of a certain form such as plain text. Examples include passing data through URLs, XML, or JSON data, all of which are plain text sort of formats that don't otherwise permit or support arbitrary binary data.

Solution 3

In addition to previous answers for base32 vs base64 in numbers. For same .pdf file encoded result is:

base64.base32encode(content) = 190400 symbols

base64.base64encode(content) = 158668 symbols

Share:
18,304
Jeff
Author by

Jeff

Updated on June 01, 2022

Comments

  • Jeff
    Jeff about 2 years

    There is enough information on how to implement base32 encoding or the specification of base32 encoding but I don't understand what it is, why we need it and where are the primary applications. Can someone please explain and give nice real life scenarios on usage? Thanks.

    crockford base32 wikipedia base32