gotp icon indicating copy to clipboard operation
gotp copied to clipboard

totp.go times other than now

Open Dr-Syn opened this issue 4 years ago • 2 comments

Good afternoon;

In the totp.go function "At" you've got an 'int' timestamp - presumably a UNIX time integer - being fed into that function.

Seeing as you've already got "time" as a dependency, perhaps it might be better for that to be a "Time" object? This way, users of the library can have the Time functions calculate the various windows and such rather than having to extract the current or future time, do the conversion, and then convert to an int to feed into that function.

I already have to call https://golang.org/pkg/time/#Unix to get that, after all

Dr-Syn avatar Nov 19 '19 23:11 Dr-Syn

Yes, actually we can add extra method which will accept Time struct as parameter.

mergenchik avatar Jan 04 '22 19:01 mergenchik

Maybe also solve #10 by adding extra method.

mergenchik avatar Jan 04 '22 19:01 mergenchik

Closing this issue, implemented in #24

mergenchik avatar Aug 17 '22 08:08 mergenchik

Oh awesome; thank you!

Dr-Syn avatar Sep 13 '22 17:09 Dr-Syn