RFC Errata
RFC 4648, "The Base16, Base32, and Base64 Data Encodings", October 2006
Source of RFC: IETF - NON WORKING GROUPArea Assignment: app
Errata ID: 4889
Status: Reported
Type: Technical
Publication Format(s) : TEXT
Reported By: Umberto Rustichelli
Date Reported: 2016-12-14
Section 6 says:
When fewer than 40 input bits are available in an input group, bits with value zero are added (on the right) to form an integral number of 5-bit groups.
It should say:
When fewer than 40 input bits are available in an input group, bits with value zero are added (on the right) to form an integral number of 8-bit groups.
Notes:
8-bit instead of 5-bit.
What follows the correction clearly shows that the final input group must be 8, 16, 24, 32 or 40 bit long, that is, a multiple of 8, not of 5.
Also examples of commonly-used Base32 encoders/decoders seem to show this behaviour.
Also, I would not say "When fewer than 40 input bits are available in an input group" but rather "When fewer than 40 input bits are available in the final input group", to better clarify and not to change the subject ambiguously, unless this is intentionally applicable to any input lot.