NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io
crates.io, #3187 most downloaded on crates.io
RFC-compliant TOTP implementation with ease of use as a goal and additional QoL features.
Latest stable
6.0.0
Last release 3 months ago
06 Aug 2026
Release timing varies
gaps range from 3 weeks to 11 months
Nearly every release is documented
notes for 26 of 27 stable releases
24 versions withdrawn
withdrawn after publishing
7 years old
51 releases · first in 2020
Drag across the ruler to compare, or tap a release to open it.
This is a BIG API change. Please check MIGRATION.md for more details.
This is a BIG API change. Please check MIGRATION.md for more details.
2024.[no_std] support with #87 and #88.Totp struct.Secret serializes 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.Totp now implements PartialEq and Eq, using Secret's constant-time comparison for the secret field.Your coding agent can read these notes before it upgrades. Set up the MCP server →
Parse algorithm from URLs more consistently. #90
Secret gets zeroized more consistently. #81
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".
MSRV has been set to Rust 1.66.
1.66.base32 crate to 0.5.constant_time_eq crate to 0.3.rand crate to 0.9.This is probably the last version update before the big 6.0, which will be a big rewrite, and the 2024 edition.
The goal will be to expose the same feature as before, but in a more harmonized and idiomatic way.
qrcodegen-image has now been moved to its own repo.
Nothing published for this version
Documentation now indicates required feature.
Full Changelog: https://github.com/constantoine/totp-rs/compare/v5.4.0...v5.5.0
SecretParseError now implements std::Error.
SecretParseError now implements std::error::Error.TOTP::get_qr was deprecated in favour of TOTP::get_qr_base64 and TOTP::get_qr_png.
qrcodegen-image subcrate to handle image creation, as the wrapper is actually nice and could be used in placed not related to totp-rs. (#61)TOTP::get_qr was deprecated in favour of TOTP::get_qr_base64 and TOTP::get_qr_png.# 5.2.0 (10/08/2023) ### Changes - Updated url crate to 2.4.
Removed unnecessary allocation for Secret.Display for the Raw variant.
Secret.Display for the Raw variant.Fix skew overflowing if value is over 128.
Normalize dependencies specifications since cargo uses range dependency by default.
MSRV has been set to Rust 1.61.
1.61.SecretParseError::Utf8Error.base64 to 0.21.url to 2.3.zeroize to 1.6.This major release is a very small one, and is mostly here to respect semver. No major change was done, it is mostly maintenance and cleanup.
Optionnals parameters in generated URLs are no longer present if their're the default value.
: was URL-encoded. (#50)Add a "steam" feature which adds support for steam's non-standard totp.
_unchecked variants for TOTP::new and TOTP::from_url, which skip certain checks like key_size and digit numbers.The year 2023 should see a lot less of breaking changes, as the library slowly approaches a form most users can happily use. This doesn't mean the lib…
1.59.base64 crate to 0.20.TOTP is no longer generic. In my opinion, while having been used in the past for some historical reasons, the generic was mostly useless as almost everyone just used bytes as a secret, prevented us from doing some work like the zeroize feature, and overall made it more complex to new users than it needed to be.This is the last release for 2022. This project has thus far been a wild ride. Originally intended for a non-profit organization, it gained traction outside of it, and soon became one the projects I'm the most proud of. It has been a pleasure learning from amazing people, and getting precious feedback from real life users. The open-source community has always been a special place to me, and being able to put in the hours to finally give something back has been, is, an amazing opportunity.
The year 2023 should see a lot less of breaking changes, as the library slowly approaches a form most users can happily use. This doesn't mean the library will stop being maintained, but I (hopefully) will stop breaking your stuff so often.
As always for every new realease, please report any issue encountered while updating totp-rs to 4.0.0.
get_qr() now returns a String as an error.
get_qr() now returns a String as an error.TOTP now implements core::fmt::DisplayRfc6238Error and TotpUrlError now implement std::error::Errorllvm-tools-preview and grcovcargo fmt'd the whole repoTotpUrlError was unexported. This is now fixed.
TotpUrlError was unexported. This is now fixed. (#29)base32 was reexported instead. It is now private, and will need to be an explicit dependency for the user to encore/decode base32 data.Secret comparison is now done in constant time.Secret handling is now less error prone thanks to #25
Default trait, which will generate a strong secret, and have sane default values according to RFC-6238 like #26Rfc6238 struct is exposed for easy Totp buildingTotp.ttl convenience method will tell remaining validity time of token (not taking skew into account)rand to generate a secretissuer and account_name won't be present anymore if feature otpauth isn't enabledThis has been, I think, the update containing the most work. While a lot of unit testing have been done, and test cases added, coverage seems to have dropped. Please report any issue encountered while updating totp-rs to 3.0.0
[otpauth] now uses urlencoding, which has no dependencies, to url-encode and url-decode values. Because doing this with the url library was kind of aw
urlencoding, which has no dependencies, to url-encode and url-decode values. Because doing this with the url library was kind of awkward.@wyhaya for discovering the first problem in #21
issuer and account_name are now members of TOTP, and thus are not used anymore as function parameters for methods
issuer and account_name are now members of TOTP, and thus are not used anymore as function parameters for methodsfrom_url() now extracts issuer and labelget_url() now needs otpauth featureget_url() now produces more correct urlsnext_step(time: u64) and next_step_current will return the timestamp of the next step's startqr enables feature otpauthAdded url dependency for otpauth feature, which adds a from_url function to parse a TOTP object from url. Thanks to @wyhaya
otpauth feature, which adds a from_url function to parse a TOTP object from url. Thanks to @wyhaya (https://github.com/constantoine/totp-rs/pull/19)Added helper functions generate_current and check_current. Thanks to @wyhaya
generate_current and check_current. Thanks to @wyhaya (https://github.com/constantoine/totp-rs/pull/17)Disabled default image features to only enable png
Removed "qrcode" library, which was abandoned years ago, to "qrcodegen", which is actively maintained
Mitigated possible timing attack as noticed per @gleb-chipiga in https://github.com/constantoine/totp-rs/issues/13
Fixed wrongful results using hmac-256 and hmac-512 thanks to @ironhaven extensive researches within RFC's in https://github.com/constantoine/totp-rs/p
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.