From 46b6fbd6ae71cae27cf48b649c6ff5ee88bcca2f Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 28 Dec 2018 19:50:07 +0100 Subject: [PATCH] use external crate siphasher Because std::hash::SipHasher is deprecated. --- Cargo.toml | 2 ++ src/catar/encoder.rs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 598e3787..11e0b456 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,3 +30,5 @@ shellwords = "1.0.0" uuid = { version = "0.7", features = ["v4"] } chrono = "0.4.6" # Date and time library for Rust openssl = "0.10.16" +siphasher = "0.3" + diff --git a/src/catar/encoder.rs b/src/catar/encoder.rs index 41a7834a..0e23fde5 100644 --- a/src/catar/encoder.rs +++ b/src/catar/encoder.rs @@ -16,6 +16,8 @@ use nix::sys::stat::Mode; use nix::errno::Errno; use nix::sys::stat::FileStat; +use siphasher::sip::SipHasher24; + const FILE_COPY_BUFFER_SIZE: usize = 1024*1024; pub struct CaTarEncoder { @@ -330,7 +332,7 @@ impl CaTarEncoder { fn compute_goodby_hash(name: &CStr) -> u64 { use std::hash::Hasher; - let mut hasher = std::hash::SipHasher::new_with_keys(0x8574442b0f1d84b3, 0x2736ed30d1c22ec1); + let mut hasher = SipHasher24::new_with_keys(0x8574442b0f1d84b3, 0x2736ed30d1c22ec1); hasher.write(name.to_bytes()); hasher.finish() } -- 2.39.5