4 ms·
https://github.com/pyramation/totp/blob/master/packages/totp/deploy/schemas/totp/procedures/generate_totp.sql#L10 https://github.com/pyramation/totp/blob/master
by pyramation 6y ago
https://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