Skip to content

Commit

Permalink
Fix examples and update CHANGELOG.md
Browse files Browse the repository at this point in the history
Signed-off-by: Cléo Rebert <cleo.rebert@gmail.com>
  • Loading branch information
constantoine committed Jan 19, 2024
1 parent e68b083 commit 0080f1d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [5.5.0](https://github.com/constantoine/totp-rs/releases/tag/v5.5.0) (19/01/2024)
### Changes
- Documentation now indicates required feature.

### Special thanks
* [@AntonnMal](https://github.com/AntonnMal) for his work on #64.

# [5.4.0](https://github.com/constantoine/totp-rs/releases/tag/v5.4.0) (04/10/2023)
### Changes
- `SecretParseError` now implements `std::error::Error`.
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-rs"
version = "5.4.0"
version = "5.5.0"
authors = ["Cleo Rebert <cleo.rebert@gmail.com>"]
rust-version = "1.61"
edition = "2021"
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ Note: With `otpauth` feature, `TOTP.issuer` will be `None`, and `TOTP.account_na
```Rust
fn main() {
let totp = TOTP::default();
let code = totp.generate_current().unwrap();
println!("code: {}", code);
}
```
Expand All @@ -224,7 +225,7 @@ Add it to your `Cargo.toml`:
```toml
[dependencies.totp-rs]
version = "^5.3"
features = ["qr"]
features = ["steam"]
```
You can then do something like:
```Rust
Expand All @@ -234,7 +235,7 @@ fn main() {
let totp = TOTP::new_steam(
Secret::Encoded("KRSXG5CTMVRXEZLUKN2XAZLSKNSWG4TFOQ".to_string()).to_bytes().unwrap(),
).unwrap();
let qr_code = totp.get_qr_base64()?;
println!("{}", qr_code);
let code = totp.generate_current().unwrap();
println!("code: {}", code);
}
```

0 comments on commit 0080f1d

Please sign in to comment.