constantoine/totp-rs

Idiomatic naming for 6.0?

Opened this issue · 1 comments

Maybe the next major release could be a good point to overhaul naming?

Would you consider a PR that:

  1. Renames TOTP to Totp.
    1. Adds a type alias, TOTP, for Totp, with a #[deprecated()] note.
  2. Swaps the get_ prefix from the resp. methods for to_.
    1. Adds methods with the old get_ prefix that just call the new ones and are marked #[deprecated()] and #[inline(always)].

1.i. and 2.i. would guarantee that old code compiles w/o changes but spits out resp. warnings.

Hi! There is indeed several... Less that fortunate choices of names and exposed API I would like to finally fix, optimally with 6.0 which will probably be more maintenance than actual business logic (in addition to move qrcodegen-image to its own repo).

In addition to TOTP's naming, I would like to review some of the errors (namely Rfc6238Error and Rfc6238's API).

Before adding deprecated notes/new API, I'd like to have a clearer, fuller picture of everything, but you are absolutely right!