doc: add features table

This commit is contained in:
MedzikUser 2022-06-12 20:55:45 +02:00
parent 870358e0b0
commit c8afcf9e42
No known key found for this signature in database
GPG Key ID: A5FAC1E185C112DB
2 changed files with 15 additions and 1 deletions

View File

@ -13,7 +13,7 @@
Cryptography Utils for Rust
### Importing
The driver is available on [crates.io](https://crates.io/crates/crypto-utils). To use the driver in
The driver is available on [crates-io](https://crates.io/crates/crypto-utils). To use the driver in
your application, simply add it to your project's `Cargo.toml`.
```toml
@ -76,4 +76,11 @@ let token = Token::new(secret, claims).unwrap();
let decoded = Token::decode(secret, token.encoded).unwrap();
```
### All Feature flags
| Feature | Description | Dependencies | Default |
|:-----------|:-------------------------------------------------------------|:-------------------------------------------|:--------|
| `sha` | Enable support for the Sha1, Sha256 and Sha512 hasher | `sha` and `sha2` | yes |
| `jwt` | Enable support for the Json Web Token utils | `chrono`, `serde` and `jsonwebtoken` | yes |
License: MIT

View File

@ -73,6 +73,13 @@
//! // decode token
//! let decoded = Token::decode(secret, token.encoded).unwrap();
//! ```
//!
//! ## All Feature flags
//!
//! | Feature | Description | Dependencies | Default |
//! |:-----------|:-------------------------------------------------------------|:-------------------------------------------|:--------|
//! | `sha` | Enable support for the Sha1, Sha256 and Sha512 hasher | `sha` and `sha2` | yes |
//! | `jwt` | Enable support for the Json Web Token utils | `chrono`, `serde` and `jsonwebtoken` | yes |
#[cfg(feature = "jwt")]
pub mod jsonwebtoken;