TOTP window startSee original GitHub issue
Totp.RemainingSecods() which however does not indicate when the current time window started. There is no way to find out the steps that the
Totp was created with (#45) so developers cannot even calculate it manually given an instance of
How about adding
- Created 5 months ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
I did #49. I also looked into
ElapsedSeconds() and since
RemainingSeconds() returns integral value (as opposed to
double), I don’t find enough value in
ElapsedSeconds() if #49 is merged since you will have acces to the
Step property and can calculate that easily (
RemainingSeconds() in practice already calculates
Step - ElapsedSeconds()).
For people who are looking for actual elapsed or remaining time (e.g. to update the OTP displayed in UI), it would be more useful to have the window start as
Fair enough - I agree that convenience properties would help in many of these cases - especially if you are not the one creating the objects and do not have access to their initial constructor argument values.
Short of submitting a pull request, you could always (as a last resort) use reflection on the private members, but this may be a non-starter for your use case, and is certainly not my go-to solution unless there is no other reasonable choice.
@kspearrin any thoughts on merits of providing public property wrappers for private members such as the Totp members _step, _totpSize, _correctedTime as well as the Otp _hashMode member? There may be a couple in the Hotp class I haven’t peeked into yet, but if this seems reasonable, I could possibly work on a pull request in the next week or so for “convenience properties” for reasonable members that are currently private/protected, as the workarounds many of us use now do have some limitations.