Skip to content

Commit

Permalink
feat(hash): add blake3 body hasher
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Apr 6, 2023
1 parent 3df0df5 commit ca7fde1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
9 changes: 6 additions & 3 deletions actix-hash/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@

## Unreleased - 2022-xx-xx

- Add `BodyBlake3` extractor.
- Minimum supported Rust version (MSRV) is now 1.64.

## 0.4.0 - 2022-07-02
- Minimum supported Rust version (MSRV) is now 1.60.

- Minimum supported Rust version (MSRV) is now 1.60.

## 0.3.0 - 2022-03-28

- Removed `BodyHashParts::body_bytes` field.
- Rename `BodyHashParts::{body => inner}` field.
- Improve fault tolerance when placed on non-body extractors.


## 0.2.0 - 2022-03-24
- Body hashing extractors for many popular, general purpose hashing algorithms.

- Body hashing extractors for many popular, general purpose hashing algorithms.

# 0.1.0

- Empty crate.
17 changes: 10 additions & 7 deletions actix-hash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,25 @@ rustdoc-args = ["--cfg", "docsrs"]
[features]
default = [
"blake2",
"md5",
"blake3",
"md4",
"md5",
"sha1",
"sha2",
"sha3",
]
blake2 = ["dep:blake2"]
md5 = ["dep:md5"]
blake3 = ["dep:blake3"]
md4 = ["dep:md4"]
md5 = ["dep:md5"]
sha1 = ["dep:sha1"]
sha2 = ["dep:sha2"]
sha3 = ["dep:sha3"]

[dependencies]
actix-http = "3"
actix-web = { version = "4", default-features = false }
actix-web-lab = "0.18.5"
actix-web-lab = "0.19"
futures-core = "0.3.17"
futures-util = { version = "0.3.17", default-features = false, features = ["std"] }
local-channel = "0.1"
Expand All @@ -47,17 +49,18 @@ tracing = { version = "0.1.30", features = ["log"] }
digest = "0.10"
subtle = "2"
blake2 = { package = "blake2", version = "0.10", optional = true }
md5 = { package = "md-5", version = "0.10", optional = true }
blake3 = { package = "blake3", version = "1.3", optional = true, features = ["traits-preview"] }
md4 = { package = "md4", version = "0.10", optional = true }
md5 = { package = "md-5", version = "0.10", optional = true }
sha1 = { package = "sha1", version = "0.10", optional = true }
sha2 = { package = "sha2", version = "0.10", optional = true }
sha3 = { package = "sha3", version = "0.10", optional = true }

[dev-dependencies]
actix-web = "4"
base64 = "0.13"
env_logger = "0.9"
hex-literal = "0.3"
base64 = "0.21"
env_logger = "0.10"
hex-literal = "0.4"

[[test]]
name = "body_hash"
Expand Down
6 changes: 5 additions & 1 deletion actix-hash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
//! # Crate Features
//! All features are enabled by default.
//! - `blake2`: Blake2 types
//! - `md4`: MD4 types 🚩
//! - `blake3`: Blake3 types
//! - `md5`: MD5 types 🚩
//! - `md4`: MD4 types 🚩
//! - `sha1`: SHA-1 types 🚩
//! - `sha2`: SHA-2 types
//! - `sha3`: SHA-3 types
Expand Down Expand Up @@ -71,3 +72,6 @@ body_hash_alias!(BodySha3_512, sha3::Sha3_512, "sha3", "SHA-3-512", 64);
// Blake2
body_hash_alias!(BodyBlake2b, blake2::Blake2b512, "blake2", "Blake2b", 64);
body_hash_alias!(BodyBlake2s, blake2::Blake2s256, "blake2", "Blake2s", 32);

// Blake3
body_hash_alias!(BodyBlake3, blake3::Hasher, "blake3", "Blake3", 32);

0 comments on commit ca7fde1

Please sign in to comment.