Update README
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
diff --git a/README.md b/README.md
index fe0630c..ea56fd7 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,10 @@ With optional feature "qr", you can use it to generate a base64 png qrcode
### serde_support
With optional feature "serde_support", library-defined types will be Deserialize-able and Serialize-able
+### otpauth
+
+With optional feature "otpauth", Support to parse the TOTP parameter from `otpauth` URL
+
## How to use
---
Add it to your `Cargo.toml`:
@@ -67,3 +71,20 @@ Add it to your `Cargo.toml`:
version = "~1.3"
features = ["serde_support"]
```
+
+### With otpauth url support
+
+Add it to your `Cargo.toml`:
+```toml
+[dependencies.totp-rs]
+version = "~1.3"
+features = ["otpauth"]
+```
+
+```Rust
+use totp_rs::TOTP;
+
+let otpauth = "otpauth://totp/GitHub:test?secret=ABC&issuer=GitHub";
+let totp = TOTP::from_url(otpauth).unwrap();
+println!("{}", totp.generate_current().unwrap());
+```
\ No newline at end of file