You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
🚀 Release Notes — v1.3.0
🐛 Bug Fixes
Algorithm name normalization — configure() now accepts algorithm names in any case (e.g. SHA256, sha256, Sha256). Previously, passing an uppercase value threw an unsupported algorithm exception. Thanks to @eliasyona for the contribution in #69.
✨ Improvements
QR code security — The demo and documentation now generate the otpauth:// URI on the backend and render the QR image locally in the browser using the qrcode library. This avoids sending the user's secret to third-party QR image APIs.
RFC 4648 Base32 padding validation — Secrets are now validated against the full RFC 4648 Base32 padding rules. Strings with invalid padding (e.g., ABCDEF==) are rejected at the boundary rather than silently misinterpreted.
Performance — TOTP verification now decodes the Base32 secret once before the time-slice loop instead of on every iteration, reducing redundant work during code verification.
max_discrepancy via factory — TotpFactory::create() now correctly passes max_discrepancy through to the constructor, so the option takes effect without needing to instantiate Totp directly.
verifyCode default discrepancy — The demo endpoint now uses a strict discrepancy of 0, accepting only the exact current time slice.
🧪 Tests
Added RFC 6238 Appendix B test vectors for SHA1, SHA256, and SHA512 to verify TOTP output against the official reference values.
Added tests for verification loop behaviour (future slice within discrepancy window, replay filtering in verifyCodeOnce).
Added test for max_discrepancy enforcement via TotpFactory::create().
Added tests for RFC 4648 padding validation in Base32::isValidUpper() and Base32::decodeUpper().