tadeck / onetimepass

One-time password library for HMAC-based (HOTP) and time-based (TOTP) passwords
http://otp.readthedocs.org/
MIT License
681 stars 101 forks source link

add clock and window parameters to totp #16

Closed angelosarto closed 9 years ago

angelosarto commented 9 years ago

extended the library to allow the time to be specified when requesting/verifying a TOTP time code - useful when trying to validate against a particular moment in the past/future and in testing clients. Also added a window parameter to TOTP verification - the window specifies how many intervals of tolerance to allow - a tolerence of 0 (the default) means the codes must fall in the same interval. The window extends in both directions - a window of 1 will have three valid codes: 1 interval behind, the current interval, and one interval ahead.

tadeck commented 9 years ago

Looks ok, I haven't found issues with this pull request.