(cherry picked from commit 191193289f
)
Co-authored-by: sakridge <sakridge@gmail.com>
This commit is contained in:
@@ -19,7 +19,7 @@ pub struct Hasher {
|
||||
|
||||
impl Hasher {
|
||||
pub fn hash(&mut self, val: &[u8]) {
|
||||
self.hasher.input(val);
|
||||
self.hasher.update(val);
|
||||
}
|
||||
pub fn hashv(&mut self, vals: &[&[u8]]) {
|
||||
for val in vals {
|
||||
@@ -29,7 +29,7 @@ impl Hasher {
|
||||
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