totp-rs
RFC-compliant TOTP implementation with ease of use as a goal and additional QoL features.
6.0.0
9.3M downloads/mo
#3234 most downloaded on crates.io
constantoine/totp-rs
What this package is like to depend on
Last release 17 days ago
06 Aug 2026
Release timing varies
gaps range from 3 weeks to 11 months
Some releases are documented
notes for 14 of 27 stable releases
24 versions withdrawn
withdrawn after publishing
6 years old
51 releases · first in 2020
3 releases in the last 12 months
see the full history below
Release timeline
51 releases · Apr 2020 to Aug 2026Releases
latest 51-
6.0.006 Aug 2026Release notes
Open source →Breaking
This is a BIG API change. Please check MIGRATION.md for more details.
What's new
- MSRV was bumped to 1.88.
- Edition was bumped to
2024. [no_std]support with #87 and #88.- We now use the builder pattern to instanciate a
Totpstruct. - Error types were unified into one Error type.
Changes
- Types and methods were renamed to more idiomatic alternatives.
- Functions that check the validity of a token now return the matched step to give user more tools to prevent token reuse. #63 ans #75.
Secretserializes to an unpadded base32 string in human-readable formats (JSON, TOML, ...) and to a raw byte string in binary formats. Deserialization accepts both, plus integer sequences from formats without a native byte type.Totpnow implementsPartialEqandEq, usingSecret's constant-time comparison for the secret field.
Special thanks
- @bushrat011899 For huge work on #87, #88.
- @Amandeepsinghghai and @sidrubs For pointing out something should be done about to avoid token reuse.
Release notes
Open source →Breaking
This is a BIG API change. Please check MIGRATION.md for more details.
What's new
- MSRV was bumped to 1.88.
- Edition was bumped to
2024. [no_std]support with #87 and #88.- We now use the builder pattern to instanciate a
Totpstruct. - Error types were unified into one Error type.
Changes
- Types and methods were renamed to more idiomatic alternatives.
- Functions that check the validity of a token now return the matched step to give user more tools to prevent token reuse. #63 ans #75.
Secretserializes to an unpadded base32 string in human-readable formats (JSON, TOML, ...) and to a raw byte string in binary formats. Deserialization accepts both, plus integer sequences from formats without a native byte type.Totpnow implementsPartialEqandEq, usingSecret's constant-time comparison for the secret field.
Special thanks
- @bushrat011899 For huge work on #87, #88.
- @Amandeepsinghghai and @sidrubs For pointing out something should be done about to avoid token reuse.
-
5.7.223 Jun 2026Release notes
Open source →Fix
- Parse algorithm from URLs more consistently. #90
Special thanks
- @deade1e for proposing a PR to fix that. It was changed in v6 but might as well fix it now.
Release notes
Open source →Fix
- Parse algorithm from URLs more consistently. #90
Special thanks
- @deade1e for proposing a PR to fix that. It was changed in v6 but might as well fix it now.
-
5.7.109 Mar 2026Release notes
Open source →Fix
- Secret gets zeroized more consistently. #81
Special thanks
- @dev-void-7 for pointing out and giving feedback on #81.
Note
This last month has seen a lot of activity on the big
6.0. No date yet, but it has gone from a nebulous "it will happen"
to a "most refactor has been done, a lot of code has been either removed or heavily changed, and the API is becoming clearer".Release notes
Open source →Fix
- Secret gets zeroized more consistently. #81
Special thanks
- @dev-void-7 for pointing out and giving feedback on #81.
Note
This last month has seen a lot of activity on the big
6.0. No date yet, but it has gone from a nebulous "it will happen" to a "most refactor has been done, a lot of code has been either removed or heavily changed, and the API is becoming clearer". -
5.7.012 Apr 2025Release notes
Open source →Breaking changes.
- MSRV has been set to Rust
1.66.
Changes
- Updated
base32crate to0.5. - Updated
constant_time_eqcrate to0.3. - Updated
randcrate to0.9. - Added a bit of documentation.
Note
This is probably the last version update before the big
6.0, which will be a big rewrite, and the2024edition.
The goal will be to expose the same feature as before, but in a more harmonized and idiomatic way.Release notes
Open source →Breaking changes.
- MSRV has been set to Rust
1.66.
Changes
- Updated
base32crate to0.5. - Updated
constant_time_eqcrate to0.3. - Updated
randcrate to0.9. - Added a bit of documentation.
Note
This is probably the last version update before the big
6.0, which will be a big rewrite, and the2024edition. The goal will be to expose the same feature as before, but in a more harmonized and idiomatic way. - MSRV has been set to Rust
-
5.6.024 Jul 2024 -
5.5.119 Jan 2024Nothing published for this version
-
5.5.019 Jan 2024Release notes
Open source →Changes
- Documentation now indicates required feature.
Special thanks
- @AntonnMal for his work on #64.
Full Changelog: v5.4.0...v5.5.0
Release notes
Open source →Changes
- Documentation now indicates required feature.
Special thanks
- @AntonnMal for his work on #64.
-
5.4.004 Oct 2023Release notes
Open source →5.4.0 (04/10/2023)
Changes
SecretParseErrornow implementsstd::error::Error.
Special thanks
- @FliegendeWurst for their work on #62.
Release notes
Open source →Changes
SecretParseErrornow implementsstd::error::Error.
Special thanks
- @FliegendeWurst for their work on #62.
-
5.3.010 Sep 2023Release notes
Open source →What's new
- Creation of a new
qrcodegen-imagesubcrate to handle image creation, as the wrapper is actually nice and could be used in placed not related tototp-rs. (#61)
Changes
TOTP::get_qrwas deprecated in favour ofTOTP::get_qr_base64andTOTP::get_qr_png.
Special thanks
- @tmpfs for their work on #60 and implementation in #61.
- Creation of a new
-
5.2.010 Aug 2023 -
5.1.015 Jul 2023Release notes
Open source →What's new
- Added some more documentation.
Fix
- Removed unnecessary allocation for
Secret.Displayfor theRawvariant.
-
5.0.215 May 2023Release notes
Open source → -
5.0.131 Mar 2023Release notes
Open source →Changes
- Normalize dependencies specifications since cargo uses range dependency by default.
Special thanks
- @bestia-dev for pointing out discrepancies in my dependency requirements.
-
5.0.028 Mar 2023Nothing published for this version
-
4.2.014 Jan 2023Nothing published for this version
-
4.1.006 Jan 2023Nothing published for this version
-
4.0.029 Dec 2022Nothing published for this version
-
3.1.003 Nov 2022Nothing published for this version
-
3.0.113 Aug 2022Release notes
Open source →Fixes
TotpUrlErrorwas unexported. This is now fixed. (#29)base32was reexported instead. It is now private, and will need to be an explicit dependency for the user to encore/decode base32 data.
Changes
Secretcomparison is now done in constant time.
Special thanks
- @alexanderkja for discovering #29.
-
3.0.009 Aug 2022 withdrawnNothing published for this version
-
2.0.116 Jun 2022Nothing published for this version
-
2.0.030 May 2022Nothing published for this version
-
1.4.006 May 2022Nothing published for this version
-
1.3.006 May 2022Nothing published for this version
-
1.2.105 May 2022 -
1.2.005 May 2022Nothing published for this version
-
1.1.024 Apr 2022Nothing published for this version
-
1.0.015 Apr 2022Nothing published for this version
-
0.7.410 Feb 2022 withdrawnNothing published for this version
-
0.7.320 Jan 2022 withdrawnNothing published for this version
-
0.7.213 Jan 2022 withdrawnNothing published for this version
-
0.7.113 Jan 2022 withdrawnNothing published for this version
-
0.6.513 Jan 2022 withdrawnNothing published for this version
-
0.6.420 Aug 2021 withdrawnNothing published for this version
-
0.6.302 Nov 2020 withdrawnNothing published for this version
-
0.6.212 Sep 2020 withdrawnNothing published for this version
-
0.6.109 Aug 2020 withdrawnNothing published for this version
-
0.6.008 Aug 2020 withdrawnNothing published for this version
-
0.5.003 Jul 2020 withdrawnNothing published for this version
-
0.4.123 Jun 2020 withdrawnNothing published for this version
-
0.4.022 Jun 2020 withdrawnNothing published for this version
-
0.3.221 Jun 2020 withdrawnNothing published for this version
-
0.3.121 Jun 2020 withdrawnNothing published for this version
-
0.3.021 Jun 2020 withdrawnNothing published for this version
-
0.2.616 Jun 2020 withdrawnNothing published for this version
-
0.2.525 Apr 2020 withdrawnNothing published for this version
-
0.2.418 Apr 2020 withdrawnNothing published for this version
-
0.2.314 Apr 2020 withdrawnNothing published for this version
-
0.2.213 Apr 2020 withdrawnNothing published for this version
-
0.2.113 Apr 2020 withdrawnNothing published for this version
-
0.2.013 Apr 2020 withdrawnNothing published for this version