pyotp icon indicating copy to clipboard operation
pyotp copied to clipboard

TOTP API documentation is missing digits argument

Open m-aciek opened this issue 6 years ago • 5 comments

Because of overriding __init__() with *args, **kwargs argument we are missing arguments documentation for base class.

m-aciek avatar Feb 15 '19 15:02 m-aciek

also the interval argument,

therealadityashankar avatar Apr 15 '19 14:04 therealadityashankar

at least in the online docs

therealadityashankar avatar Apr 15 '19 14:04 therealadityashankar

also, and before I point the issue, just wanna say it's really awesome you made this library, :heart:,

It'll be really nice if you put that initiation time is 0 with reference to time.time() in totps' (I figured this from the source code)

therealadityashankar avatar Apr 15 '19 16:04 therealadityashankar

Any reason why TOTP.now() is limited to only 10 digits?

>>> import pyotp
>>> totp = pyotp.TOTP('mysecret', digits=11)
>>> totp.now()
'01955539658'
>>>

pythonmobile avatar Mar 08 '22 04:03 pythonmobile

pythonmobile: totp.now() will generate up to an 11-character string, if asked to. Due to the 31-bit truncation stipulated by RFC 4226, only 9 cryptologically meaningful digits can be generated. The 10th digit (i.e., string index 1) is almost always going to be a '0' or '1', occasionally '2'. For reasons I'm still exploring, the version of pyotp I'm using (2.8.0) always generates a '1' in the left-most digit place. (sorry for the necropost)

schongallam avatar May 04 '23 14:05 schongallam