constantoine/totp-rs

How do I import this kind of secret?

Closed this issue · 1 comments

How do I import this kind of secret?
1234 5678 90ab cdef ghij klmn nopq rstu (example)

What algorithm is it?
How many digits, skew, and steps?
Is it raw or encoded?

EDIT: I suggest an easier-to-use simple function that takes the secret input and returns the 2FA TOTP code, handling all the detection of those variables in the library which would make the library much more useful, similar to how password managers and apps already do this

Hello,

In your case, it's impossible to infer anything. The secret as you show me looks encoded, but once again it might not.

In case of QR scanning, or url scanning, everything is detected by the library, because there is additional info and not just the secret.

Such a function can't exist since you can't guess that from the secret. Altho, standards/default value (as refered in the docs) can be set automatically, which is how those library "detect" those.. I refer to you this example from the README.