Skip to content

Commit

Permalink
Update generic_array
Browse files Browse the repository at this point in the history
Warning: this may have performance implications.
  • Loading branch information
garious committed Jun 19, 2018
1 parent 0de5e7a commit 3f91b0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ erasure = []
[dependencies]
rayon = "1.0.0"
sha2 = "0.7.0"
generic-array = { version = "0.9.0", default-features = false, features = ["serde"] }
generic-array = { version = "0.11.1", default-features = false, features = ["serde"] }
serde = "1.0.27"
serde_derive = "1.0.27"
serde_json = "1.0.10"
Expand Down
5 changes: 4 additions & 1 deletion src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ pub type Hash = GenericArray<u8, U32>;
pub fn hash(val: &[u8]) -> Hash {
let mut hasher = Sha256::default();
hasher.input(val);
hasher.result()

// At the time of this writing, the sha2 library is stuck on an old version
// of generic_array (0.9.0). Decouple ourselves with a clone to our version.
GenericArray::clone_from_slice(hasher.result().as_slice())
}

/// Return the hash of the given hash extended with the given value.
Expand Down

0 comments on commit 3f91b0c

Please sign in to comment.