chore(release): v0.4.1
This commit is contained in:
parent
cac8f7f6da
commit
56175287f9
|
@ -13,7 +13,7 @@ env:
|
|||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build:
|
||||
rust:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
|
41
CHANGELOG.md
41
CHANGELOG.md
|
@ -1,41 +0,0 @@
|
|||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
<!-- next-header -->
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.4.0] - 2022-06-29
|
||||
### Features
|
||||
- **sha**: Added HMAC Sha1, HMAC Sha256 and HMAC Sha512
|
||||
|
||||
## [0.3.0] - 2022-06-23
|
||||
- updated dependencies
|
||||
### Features
|
||||
- **jwt**: pub use type `TokenData`
|
||||
|
||||
## [0.2.1] - 2022-06-18
|
||||
### Added
|
||||
- [Examples](https://github.com/MedzikUser/rust-crypto-utils/tree/v0.2.1/examples)
|
||||
### Changed
|
||||
- update rust crate jsonwebtoken to 8.1.1
|
||||
|
||||
## [0.2.0] - 2022-06-11
|
||||
### Added
|
||||
- Json Web Token
|
||||
|
||||
## [0.1.0] - 2022-06-11
|
||||
### Added
|
||||
- Sha1, Sha256, Sha512 hasher
|
||||
|
||||
<!-- next-url -->
|
||||
[Unreleased]: https://github.com/MedzikUser/rust-crypto-utils/compare/v0.4.0...HEAD
|
||||
[0.4.0]: https://github.com/MedzikUser/rust-crypto-utils/commits/v0.4.0
|
||||
[0.3.0]: https://github.com/MedzikUser/rust-crypto-utils/commits/v0.3.0
|
||||
[0.2.1]: https://github.com/MedzikUser/rust-crypto-utils/commits/v0.2.1
|
||||
[0.2.0]: https://github.com/MedzikUser/rust-crypto-utils/commits/v0.2.0
|
||||
[0.1.0]: https://github.com/MedzikUser/rust-crypto-utils/commits/v0.1.0
|
|
@ -98,7 +98,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "crypto-utils"
|
||||
version = "0.4.0"
|
||||
version = "0.4.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
[package]
|
||||
name = "crypto-utils"
|
||||
version = "0.4.0"
|
||||
version = "0.4.1"
|
||||
description = "Cryptography Utils for Rust"
|
||||
authors = ["MedzikUser <nivua1fn@duck.com>"]
|
||||
authors = ["MedzikUser <medzik@duck.com>"]
|
||||
license = "MIT"
|
||||
keywords = ["crypto", "sha"]
|
||||
categories = ["cryptography"]
|
||||
|
@ -27,4 +27,4 @@ thiserror = "1.0.35"
|
|||
|
||||
[dev-dependencies]
|
||||
anyhow = "1.0.65"
|
||||
hex = { version = "0.4.3" }
|
||||
hex = "0.4.3"
|
||||
|
|
24
README.md
24
README.md
|
@ -1,4 +1,4 @@
|
|||
# crypto-utils
|
||||
# Cryptography Utils for Rust
|
||||
|
||||
[![github]](https://github.com/MedzikUser/rust-crypto-utils)
|
||||
[![crates-io]](https://crates.io/crates/crypto-utils)
|
||||
|
@ -13,25 +13,18 @@
|
|||
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
|
||||
[dependencies]
|
||||
crypto-utils = "0.4.0"
|
||||
crypto-utils = "0.4.1"
|
||||
```
|
||||
|
||||
### How to use?
|
||||
|
||||
#### Compute a Sha hash
|
||||
|
||||
Add `sha` features (is enabled by default)
|
||||
|
||||
```toml
|
||||
[dependencies]
|
||||
crypto-utils = { version = "...", features = ["sha"] }
|
||||
```
|
||||
|
||||
Quick and easy Sha1, Sha256 and Sha512 hash computing.
|
||||
|
||||
```rust
|
||||
|
@ -51,13 +44,6 @@ assert_eq!(hash, "21bd12dc183f740ee76f27b78eb39c8ad972a757".to_string())
|
|||
|
||||
#### Json Web Token
|
||||
|
||||
Add `jwt` features (is enabled by default)
|
||||
|
||||
```toml
|
||||
[dependencies]
|
||||
crypto-utils = { version = "...", features = ["jwt"] }
|
||||
```
|
||||
|
||||
Create and decode a token
|
||||
|
||||
```rust
|
||||
|
@ -66,13 +52,9 @@ use crypto_utils::jsonwebtoken::{Claims, Token};
|
|||
let secret = b"secret";
|
||||
let user_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
|
||||
// create claims
|
||||
let claims = Claims::new(user_id, 24);
|
||||
|
||||
// create token
|
||||
let token = Token::new(secret, claims).unwrap();
|
||||
|
||||
// decode token
|
||||
let decoded = Token::decode(secret, token.encoded).unwrap();
|
||||
```
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
//!
|
||||
//! ## How to use?
|
||||
//!
|
||||
//! Check [jsonwebtoken] and [sha] module
|
||||
//! Check [jsonwebtoken] and [sha] modules.
|
||||
//!
|
||||
//! ## All Feature flags
|
||||
//!
|
||||
|
|
Loading…
Reference in New Issue