near-stable-hasher

Crates.ionear-stable-hasher
lib.rsnear-stable-hasher
version0.22.0
sourcesrc
created_at2021-10-04 07:12:11.686138
updated_at2024-05-17 14:34:51.383404
description`near-stable-hasher` is a library that is essentially a wrapper around, now deprecated, `std::hash::SipHasher`.
homepage
repositoryhttps://github.com/near/nearcore
max_upload_size
id460000
size15,377
(nearprotocol-ci)

documentation

README

near-stable-hasher

near-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.

Structs

This crate provides only one struct. See StableHasher.

Example:

fn test_stable_hasher() {
  let mut sh = StableHasher::new();

  sh.write(&[1, 2, 3, 4, 5]);
  let finish = sh.finish();
  assert_eq!(finish, 12661990674860217757)
}
Commit count: 7307

cargo fmt