Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace xxhash with ahash #51

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ exclude = ["decodecorpus_files/*", "dict_tests/*", "fuzz_decodecorpus/*"]
readme = "Readme.md"

[dependencies]
ahash = { version = "0.8", default-features = false }
byteorder = { version = "1.5", default-features = false }
twox-hash = { version = "1.6", default-features = false }
derive_more = { version = "0.99", default-features = false, features = ["display", "from"] }

[dev-dependencies]
Expand Down
8 changes: 3 additions & 5 deletions src/decoding/decodebuffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ use crate::io::{Error, Read, Write};
use alloc::vec::Vec;
use core::hash::Hasher;

use twox_hash::XxHash64;

use super::ringbuffer::RingBuffer;

pub struct Decodebuffer {
Expand All @@ -12,7 +10,7 @@ pub struct Decodebuffer {

pub window_size: usize,
total_output_counter: u64,
pub hash: XxHash64,
pub hash: ahash::AHasher,
}

#[derive(Debug, derive_more::Display)]
Expand Down Expand Up @@ -47,7 +45,7 @@ impl Decodebuffer {
dict_content: Vec::new(),
window_size,
total_output_counter: 0,
hash: XxHash64::with_seed(0),
hash: Default::default(),
}
}

Expand All @@ -57,7 +55,7 @@ impl Decodebuffer {
self.buffer.reserve(self.window_size);
self.dict_content.clear();
self.total_output_counter = 0;
self.hash = XxHash64::with_seed(0);
self.hash = Default::default();
}

pub fn len(&self) -> usize {
Expand Down
Loading