* Changed version to 0.4.0 and updated docs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
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 <cleo.rebert@gmail.com>"]
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);
//! ```