Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not generate every token in the specified time-window #488

Merged
merged 3 commits into from
Apr 19, 2024

Conversation

air2
Copy link
Contributor

@air2 air2 commented Apr 17, 2024

This will immidiatly return when a correct token is found. It will also start with comparing the token against the one for the current time, then 1 token before the current time, 1 after, 2 before the current time etc.. until the complete window is compared or a valid token is found.

This should improve performance, because most of the time the current token or the previous token is submitted.

This should fix #487

src/hotp.js Outdated Show resolved Hide resolved
@air2 air2 requested a review from hectorm April 19, 2024 05:38
@hectorm hectorm merged commit e329203 into hectorm:master Apr 19, 2024
24 checks passed
@hectorm
Copy link
Owner

hectorm commented Apr 19, 2024

Merged, thanks!

@air2
Copy link
Contributor Author

air2 commented Apr 19, 2024

Thank you for the fast response and the work on this package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

To much code generation with a window size + 1
2 participants