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

TOTP API documentation is missing digits argument #75

Open
m-aciek opened this issue Feb 15, 2019 · 5 comments
Open

TOTP API documentation is missing digits argument #75

m-aciek opened this issue Feb 15, 2019 · 5 comments

Comments

@m-aciek
Copy link

m-aciek commented Feb 15, 2019

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

@therealadityashankar
Copy link

also the interval argument,

@therealadityashankar
Copy link

at least in the online docs

@therealadityashankar
Copy link

therealadityashankar commented Apr 15, 2019

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

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)

@pythonmobile
Copy link

pythonmobile commented Mar 8, 2022

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

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

@schongallam
Copy link

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)

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

No branches or pull requests

4 participants