From 2c12f476521728f0404dc13249d16eadf548b826 Mon Sep 17 00:00:00 2001 From: Mark Nijboer Date: Mon, 22 Jun 2020 16:16:05 +0200 Subject: [PATCH] * Changed version to 0.4.0 and updated docs --- Cargo.toml | 2 +- README.md | 6 ++---- src/lib.rs | 6 ++---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cc05ed1..16f5bad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "totp-rs" -version = "0.3.2" +version = "0.4.0" authors = ["Cleo Rebert "] edition = "2018" readme = "README.md" diff --git a/README.md b/README.md index f372113..0e204f4 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ You can then do something like: use std::time::SystemTime; use totp_rs::{Algorithm, TOTP}; -let username = "example".to_owned(); let totp = TOTP::new( Algorithm::SHA1, 6, @@ -25,7 +24,7 @@ let totp = TOTP::new( let time = SystemTime::now() .duration_since(SystemTime::UNIX_EPOCH).unwrap() .as_secs(); -let url = totp.get_url(format!("account:{}", username), "my-org.com".to_owned()); +let url = totp.get_url("user@example.com", "my-org.com"); println!("{}", url); let token = totp.generate(time); println!("{}", token); @@ -43,7 +42,6 @@ You can then do something like: ```Rust use totp_rs::{Algorithm, TOTP}; -let username = "example".to_owned(); let totp = TOTP::new( Algorithm::SHA1, 6, @@ -51,6 +49,6 @@ let totp = TOTP::new( 30, "supersecret".to_owned().into_bytes(), ); -let code = totp.get_qr(format!("account:{}", username), "my-org.com".to_owned())?; +let code = totp.get_qr("user@example.com", "my-org.com")?; println!("{}", code); ``` diff --git a/src/lib.rs b/src/lib.rs index f63dc1e..1c7b54f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,7 +6,6 @@ //! use std::time::SystemTime; //! use totp_rs::{Algorithm, TOTP}; //! -//! let username = "example"; //! let totp = TOTP::new( //! Algorithm::SHA1, //! 6, @@ -17,7 +16,7 @@ //! let time = SystemTime::now() //! .duration_since(SystemTime::UNIX_EPOCH).unwrap() //! .as_secs(); -//! let url = totp.get_url(username, "my-org.com"); +//! let url = totp.get_url("user@example.com", "my-org.com"); //! println!("{}", url); //! let token = totp.generate(time); //! println!("{}", token); @@ -26,7 +25,6 @@ //! ```rust //! use totp_rs::{Algorithm, TOTP}; //! -//! let username = "example"; //! let totp = TOTP::new( //! Algorithm::SHA1, //! 6, @@ -34,7 +32,7 @@ //! 30, //! "supersecret".to_owned().into_bytes(), //! ); -//! let code = totp.get_qr(username, "my-org.com").unwrap(); +//! let code = totp.get_qr("user@example.com", "my-org.com").unwrap(); //! println!("{}", code); //! ```