base32.js
base32.js copied to clipboard
Does not correctly handle base32 that is not a multiple of 8 in length
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'