crates: update rapidhash

This commit is contained in:
nym21
2025-07-24 17:32:38 +02:00
parent 3f237689da
commit 49a66f72fc
4 changed files with 20 additions and 22 deletions

View File

@@ -16,7 +16,7 @@ derive_deref = { workspace = true }
fjall = { workspace = true }
jiff = { workspace = true }
log = { workspace = true }
rapidhash = "1.4.0"
rapidhash = "2.0.2"
rlimit = "0.10.2"
serde = { workspace = true }
serde_bytes = { workspace = true }

View File

@@ -25,9 +25,7 @@ pub struct AddressBytesHash([u8; 8]);
impl From<(&AddressBytes, OutputType)> for AddressBytesHash {
fn from((address_bytes, outputtype): (&AddressBytes, OutputType)) -> Self {
let mut hasher = rapidhash::RapidHasher::default();
hasher.write(address_bytes.as_slice());
let mut slice = hasher.finish().to_le_bytes();
let mut slice = rapidhash::v3::rapidhash_v3(address_bytes.as_slice()).to_le_bytes();
slice[0] = slice[0].wrapping_add(outputtype as u8);
Self(slice)
}