go-multibase
go-multibase copied to clipboard
Test illustrating failure with a sole '2' as encoded string
I am not entirely sure what's going on here, so filing this as a PR before I move on. Specfically the encodings specified as 'non-padding' should not be having trouble here. Yet:
--- FAIL: TestRoundTrip (0.00s)
multibase_test.go:55: encoding failed for b (98 / base32), expected: b2, got: b
multibase_test.go:55: encoding failed for v (118 / base32hex), expected: v2, got: v
multibase_test.go:126: base64 decode of '2' failed: illegal base64 data at input byte 0
Please do not close until we have investigated.
That would be less than one byte decoded. '2' in base64 would be 0x54. This would "decode" to the upper 6 bits of 0xd8. However, we still need the lower two bits ('A').
Right but we spec these explicitly as "no padding"... This is why I wanted to circle back to it when I'm less distracted, reason through, and potentially add some more text to the specs.
@aschmahmann @lidel is this of any to investigate? If not - I will close...