Base32 encoding produces incorrect values when 7's are used in a segment less than 40 bits
Some unit test cases have been added to re-produce the problem. Currently the tests don't pass. The test cases have been verified with Google's implementation of Base32 encoding (the de-facto standard with TOTP)
This doesn't affect decoding. That appears to be correct.