daegalus / dart-otp

RFC6238 Time-Based One-Time Password / Google Authenticator Library
MIT License
100 stars 25 forks source link

Allow lowercase base32 strings if isGoogle is set to true #46

Closed amadejkastelic closed 1 year ago

amadejkastelic commented 1 year ago

This PR adds support for lower-case Base32 strings to match the behaviour of Google Authenticator. _generateCode function now always converts strings to upper-case if isGoogle is set to true before calling base32.decode.

Tested this by importing the key provided in #44 to Google Authentication and checking if it generates the same codes for lower and uppercase secret.

Fixes #44 and #45.

daegalus commented 1 year ago

Sorry for the delay, thank you for this PR. I will get this merged and released shortly.

daegalus commented 1 year ago

3.1.4 is released with your fix, thank you.

chickahoona commented 1 year ago

Thank you both!