• Gustav Westling's avatar
    encoding/base32: make NoPadding Encoding's DecodedLen return exact size · d1340ee2
    Gustav Westling authored
    CL 47341 added support for decoding non-padded messages. But DecodedLen
    still returned a multiple of 5 for messages without a padding, even
    though it is possible to calculate the len exactly when using NoPadding.
    
    This change makes DecodedLen return the exact number of bytes that
    will be written. A change to the decoding logic is also made so that it
    can handle this case.
    
    DecodedLen now has the same behaviour as DecodedLen in encoding/base64.
    
    Fixes #20854
    
    Change-Id: I729e0b1c0946c866fb675c854f835f366dd4b5a4
    Reviewed-on: https://go-review.googlesource.com/47710Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    d1340ee2
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...