Crates.io | unc-stable-hasher |
lib.rs | unc-stable-hasher |
version | 0.10.2 |
source | src |
created_at | 2024-03-06 09:07:05.481162 |
updated_at | 2024-05-15 07:36:16.297096 |
description | `unc-stable-hasher` is a library that is essentially a wrapper around, now deprecated, `std::hash::SipHasher`. |
homepage | |
repository | https://github.com/utnet-org/utility |
max_upload_size | |
id | 1164566 |
size | 38,143 |
unc-stable-hasher
unc-stable-hasher
is a library that is essentially a wrapper around, now deprecated, std::hash::SipHasher
.
Its purpose is to provide a stable hash function, which doesn't change depending on rust_version
, architecture
, platform
,
time
, etc.
In addition, note that SipHasher
is deprecated since Rust
1.13.0
.
Eventually SipHasher
will be removed from Rust
.
We need to ensure, nothing breaks during this transition period.
This crate provides only one struct. See StableHasher
.
fn test_stable_hasher() {
let mut sh = StableHasher::new();
sh.write(&[1, 2, 3, 4, 5]);
let finish = sh.finish();
assert_eq!(finish, 12661990674860217757)
}