alexxandergrib / otp Goto Github PK
View Code? Open in Web Editor NEWTypescript library to work with Google Authenticator/TOTP/HOTP
License: MIT License
Typescript library to work with Google Authenticator/TOTP/HOTP
License: MIT License
Hello @AlexXanderGrib
I came across your project and I have to say that it deserves far more love and consideration. Most of otp projects are unmaintained or bad designed, when yours is fast, efficient and clean. I'll start to use it soon in a production app.
If I open this post, apart from congratulating you, is that I would like to see functions to encode/decode the secret generated from generateKey.
Currently the process is pretty simple, we generate a key with generateKey, create the totp URL with getKeyUri (and in this process I believe that you convert the Uint8Array bytes from generateKey to the string secret we can see in the built URL).
For now I JSON.stringify the result of generateKey to get a storable secret to keep it linked to the user, and then I reconstruct the Uint8Array from an iterable function when I need it, it works pretty well but I find it ugly. I'd like to be able to go from the bytes generated by generateKey to the string secret in the totp URL and back to the Uint8Array.
It would be cleaner I think to store the secret as it is in the URL and then be able to challenge the code given by the user from this string secret.
Again congratulations for this project, I wish you the best !
Regards,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.