Upgrade sha2 to 0.9.3 (#14746)
This commit is contained in:
@@ -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