base32.js icon indicating copy to clipboard operation
base32.js copied to clipboard

Does not correctly handle base32 that is not a multiple of 8 in length

Open tommilligan opened this issue 4 years ago • 0 comments

Found while investigating a bug in speakeasy. It's easy to demonstrate that values of length, 8, 16, 24 etc. roundtrip correctly, but other lengths do not:

> b.encode(b.decode("ABCDEFGH"))
'ABCDEFGH'
> b.encode(b.decode("ABCDEFG"))
'ABCDEFGA'
> b.encode(b.decode("ABCDEFG="))
'ABCDEFGA'

tommilligan avatar Feb 05 '21 09:02 tommilligan