totp_rfc6238
A rust crate for generating TOTP codes (tokens) defined in RFC 6238.
Features of this crate
- Both low-level and high-level APIs are provided.
- The length of the codes, the initial counter time (T0), update time interval (period) and hash algorithm are configurable.
- HMAC algorithms are implemented by ring.
- Read or write "Key Uri Format"
(URIs start with
otpauth://totp/
) (theoathuri
feature gate). - Read or write
key
from base32-encoded string (theoathuri
feature gate).
Note
This implementation does NOT consider the time earlier than the
Unix epoch (1970-01-01T00:00:00Z
).
Example
use ;
Changelog
See here.
Incompatible API breaking changes
- v0.3.1 -> v0.4.0
- v0.2.0 -> v0.3.0
Warning
The codes of this crate has not been audited.
Features that may be related to but NOT implemented in this crate
- Read or write QR codes.
Contribution
- Any contribution intentionally submitted for inclusion in openssl-src by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
- Pull requests are always welcome.
License
This tool is primarily distributed under the terms of both the MIT license
and the Apache License (Version 2.0), with portions covered by various
BSD-like licenses.
See LICENSE-APACHE, LICENSE-MIT for details.