Upgrade sha2 to 0.9.3 (#14746)
This commit is contained in:
@@ -14,7 +14,7 @@ bv = { version = "0.11.1", features = ["serde"] }
|
||||
log = "0.4.11"
|
||||
serde = "1.0.112"
|
||||
serde_derive = "1.0.103"
|
||||
sha2 = "0.8.2"
|
||||
sha2 = "0.9.2"
|
||||
solana-frozen-abi-macro = { path = "macro", version = "1.6.0" }
|
||||
thiserror = "1.0"
|
||||
|
||||
|
@@ -12,12 +12,12 @@ pub struct Hasher {
|
||||
|
||||
impl Hasher {
|
||||
pub fn hash(&mut self, val: &[u8]) {
|
||||
self.hasher.input(val);
|
||||
self.hasher.update(val);
|
||||
}
|
||||
pub fn result(self) -> Hash {
|
||||
// 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.
|
||||
Hash(<[u8; HASH_BYTES]>::try_from(self.hasher.result().as_slice()).unwrap())
|
||||
Hash(<[u8; HASH_BYTES]>::try_from(self.hasher.finalize().as_slice()).unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user