Skip to content

Commit

Permalink
version 0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
KaneGreen committed Aug 15, 2024
1 parent b57d472 commit 9142eaa
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Changelog
## v0.6.1
* Improved the documentation. No actual code changes.
## v0.6.0
* Using RustCrypto's SHA implementation by default, instead of Ring.
* Improved the documentation.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "totp_rfc6238"
version = "0.6.0"
version = "0.6.1"
authors = ["KaneGreen <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ A rust crate for generating TOTP codes (tokens) defined in [RFC 6238](https://to
## 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](https://crates.io/crates/ring).
(period) and hash algorithm are configurable.
* HMAC algorithms are implemented by [RustCrypto](https://github.com/RustCrypto) or [ring](https://crates.io/crates/ring).
* Read or write "[Key Uri Format](https://github.com/google/google-authenticator/wiki/Key-Uri-Format)"
(URIs start with `otpauth://totp/`) (the `oathuri` feature gate).
(URIs start with `otpauth://totp/`) (the `oathuri` feature gate).
* Read or write `key` from base32-encoded string (the `oathuri` feature gate).

### Select SHA implementation
* using [RustCrypto](https://github.com/RustCrypto/MACs/tree/master/hmac)'s implementation (default)
* using [RustCrypto](https://github.com/RustCrypto/hashes)'s implementation (default)
```toml
[dependencies]
totp_rfc6238 = "0.6"
Expand All @@ -38,7 +38,7 @@ fn main() {
// 30 seconds, starting at "Jan 01 1970 00:00:00 UTC", using HMAC-SHA1.
let mut totp_generator = TotpGenerator::new().build();

// Assuming you read the key from some secure area
// Assuming you have read the key from somewhere secure
let key = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890+/";

let output1 = totp_generator.get_code(key);
Expand Down Expand Up @@ -70,6 +70,7 @@ fn main() {

## Changelog
See [here](./CHANGELOG.md).

### Incompatible API breaking changes
The version number lower than `1.0.0` should be regarded as an unstable version
of the API. Therefore, some version updates may contain incompatible API
Expand All @@ -89,6 +90,7 @@ 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.
* HMAC-based One-Time Password (HOTP) algorithm as defined in RFC 4226.

## License
This tool is primarily distributed under the terms of both the MIT license
Expand All @@ -100,4 +102,4 @@ See [LICENSE-APACHE](LICENSE-APACHE), [LICENSE-MIT](LICENSE-MIT) for details.
1. Any contribution intentionally submitted for inclusion in totp_rfc6238 by
you, as defined in the Apache-2.0 license, shall be dual licensed as above,
without any additional terms or conditions.
2. Pull requests are always welcome.
2. Pull requests are always welcome.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! * 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](https://crates.io/crates/ring).
//! * HMAC algorithms are implemented by [RustCrypto](https://github.com/RustCrypto) or [ring](https://crates.io/crates/ring).
//! * Read or write "[Key Uri Format](https://github.com/google/google-authenticator/wiki/Key-Uri-Format)"
//! (URIs start with `otpauth://totp/`) (the `oathuri` feature gate).
//! * Read or write `key` from base32-encoded string (the `oathuri` feature
Expand Down
2 changes: 1 addition & 1 deletion src/oath_uri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! ```toml
//! # Cargo.toml
//! [dependencies]
//! totp_rfc6238 = { version = "0.4", features = [ "oathuri" ]}
//! totp_rfc6238 = { version = "0.6", features = [ "oathuri" ]}
//! ```
//!
//! The functions and methods in this module will automatically try to
Expand Down

0 comments on commit 9142eaa

Please sign in to comment.