3 ms·
Cool! I remember seeing a pg TOTP implementation in this gist[1] before. Seems this extension was based off that? [1]: https://gist.github.com/bwbroersma/676d0
by steve-chavez 6y ago
Cool! I remember seeing a pg TOTP implementation in this gist[1] before. Seems this extension was based off that?
[1]: https://gist.github.com/bwbroersma/676d0de32263ed554584ab132434ebd9 https://gist.github.com/bwbroersma/676d0de32263ed554584ab132...
- pyramation 6y agohttps://github.com/pyramation/totp/blob/master/packages/totp/deploy/schemas/totp/procedures/generate_totp.sql#L10 https://github.com/pyramation/totp/blob/master/packages/totp... yes in the notes of the source here The first TOTP implementation I wrote was here was much less efficient, literally the algorithm in steps: https://github.com/pyramation/learn-totp/blob/master/packages/totp/sql/launchql-totp--0.0.1.sql https://github.com/pyramation/learn-totp/blob/master/package... That gist is essentially the pure TOTP algo, but it was missing what we use in industry practice that the RFC was missing... base32 encode/decode. So I implemented a base32 encode/decode so that the TOTP algo actually works with google authenticator and authy https://github.com/pyramation/totp/blob/master/extensions/%40launchql/base32/sql/launchql-base32--0.0.3.sql https://github.com/pyramation/totp/blob/master/extensions/%4... When I found the gist, while the original code worked, the gist was much smaller (used more efficient bitwise operations) and the gist author I collaborated briefly and decided to combine the gist and the code for OSS