Bits are lost when removing padding in function `base32tohex`
Closed this issue · 1 comments
olfek commented
Authenticator/src/models/key-utilities.ts
Line 67 in 284faca
I found an actual bug this time. @mymindstorm
Consider this example:
Input:
base32tohex("KK======")
Where KK
is 01010 01010
Output in hex: 52
(01010 010
)
The last 2 bits 10
have been lost.
The code to remove padding is removing too much.
olfek commented
KK
is not a valid sequence of octets, my bad 😅