On Tue, Dec 12, 2017 at 3:13 PM, Jeffrey Goldberg <j...@agilebits.com> wrote:
>
>> On Dec 12, 2017, at 9:00 AM, Ian Lance Taylor <i...@golang.org> wrote:
>
>> DecodedLen is supposed to be applied to the length of the encoded
>> data.  RFC 4648 says that the encoded data must be padded to be a
>> multiple of 8 bytes.
>
> Yet encoding/hash32 defines a NoPadding constant, the code is filled
> with tests for whether the padding has been set to NoPadding, and the package
> docs make reference to setting things with NoPadding.

Yes.  But even with the no padding case, it is impossible to have an
encoded length of a single byte (I tried to say that in a bit of the
message that you didn't quote).  And I hope we can all agree that
`DecodedLen` returns the correct value when called with an argument of
2 when `padChar == NoPadding`.  So we are only talking about the value
1, which I assert is impossible in a valid base32 encoded string with
no padding.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to