-
Notifications
You must be signed in to change notification settings - Fork 618
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove near-stable-hasher dep from near-vm-runner (#9270)
Part of #8197
- Loading branch information
1 parent
b5921f2
commit 9cb316c
Showing
7 changed files
with
20 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use std::hash::{Hash, Hasher}; | ||
|
||
pub(crate) fn stable_hash<T: Hash>(value: T) -> u64 { | ||
// This is ported over from the previous uses, that relied on near-stable-hasher. | ||
// The need for stability here can certainly be discussed, and it could probably be replaced with DefaultHasher. | ||
// Not doing it in this refactor as it’s not the core of the issue and using SipHasher is an easy alternative. | ||
#[allow(deprecated)] | ||
let mut hasher = std::hash::SipHasher::new(); | ||
value.hash(&mut hasher); | ||
hasher.finish() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters