Update README
This commit is contained in:
parent
3233669847
commit
905a119c10
21
README.md
21
README.md
|
@ -12,6 +12,10 @@ With optional feature "qr", you can use it to generate a base64 png qrcode
|
||||||
### serde_support
|
### serde_support
|
||||||
With optional feature "serde_support", library-defined types will be Deserialize-able and Serialize-able
|
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
|
## How to use
|
||||||
---
|
---
|
||||||
Add it to your `Cargo.toml`:
|
Add it to your `Cargo.toml`:
|
||||||
|
@ -67,3 +71,20 @@ Add it to your `Cargo.toml`:
|
||||||
version = "~1.3"
|
version = "~1.3"
|
||||||
features = ["serde_support"]
|
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());
|
||||||
|
```
|
Loading…
Reference in New Issue