Skip to content

Commit

Permalink
chore(deps): Bump twox-hash from 1.6.3 to 2.0.1 (#19258)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bugen Zhao <i@bugenzhao.com>
Co-authored-by: xxchan <xxchan22f@gmail.com>
  • Loading branch information
3 people authored Dec 18, 2024
1 parent fe84f69 commit 94ccd00
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 19 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/batch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ tokio-postgres = "0.7"
tokio-stream = { workspace = true }
tonic = { workspace = true }
tracing = "0.1"
twox-hash = "1"
twox-hash = "2"

[target.'cfg(not(madsim))'.dependencies]
workspace-hack = { path = "../workspace-hack" }
Expand Down
2 changes: 1 addition & 1 deletion src/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ tracing = "0.1"
tracing-futures = { version = "0.2", features = ["futures-03"] }
tracing-opentelemetry = { workspace = true }
tracing-subscriber = "0.3.17"
twox-hash = "1"
twox-hash = "2"
url = "2"
uuid = { version = "1", features = ["v4"] }

Expand Down
4 changes: 1 addition & 3 deletions src/common/src/array/bool_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,6 @@ mod tests {
fn test_bool_array_hash() {
use std::hash::BuildHasher;

use twox_hash::RandomXxHashBuilder64;

use super::super::test_util::{hash_finish, test_hash};

const ARR_NUM: usize = 2;
Expand Down Expand Up @@ -286,7 +284,7 @@ mod tests {
.map(|v| helper_test_builder(v.clone()))
.collect_vec();

let hasher_builder = RandomXxHashBuilder64::default();
let hasher_builder = twox_hash::xxhash64::RandomState::default();
let mut states = vec![hasher_builder.build_hasher(); ARR_LEN];
vecs.iter().for_each(|v| {
v.iter()
Expand Down
4 changes: 1 addition & 3 deletions src/common/src/array/decimal_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ mod tests {
fn test_decimal_array_hash() {
use std::hash::BuildHasher;

use twox_hash::RandomXxHashBuilder64;

use super::super::test_util::{hash_finish, test_hash};

const ARR_NUM: usize = 3;
Expand Down Expand Up @@ -118,7 +116,7 @@ mod tests {
})
.collect_vec();

let hasher_builder = RandomXxHashBuilder64::default();
let hasher_builder = twox_hash::xxhash64::RandomState::default();
let mut states = vec![hasher_builder.build_hasher(); ARR_LEN];
vecs.iter().for_each(|v| {
v.iter()
Expand Down
4 changes: 1 addition & 3 deletions src/common/src/array/utf8_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,6 @@ mod tests {
fn test_utf8_array_hash() {
use std::hash::BuildHasher;

use twox_hash::RandomXxHashBuilder64;

use super::super::test_util::{hash_finish, test_hash};

const ARR_NUM: usize = 3;
Expand Down Expand Up @@ -368,7 +366,7 @@ mod tests {

let arrs = vecs.iter().map(Utf8Array::from_iter).collect_vec();

let hasher_builder = RandomXxHashBuilder64::default();
let hasher_builder = twox_hash::xxhash64::RandomState::default();
let mut states = vec![hasher_builder.build_hasher(); ARR_LEN];
vecs.iter().for_each(|v| {
v.iter()
Expand Down
2 changes: 1 addition & 1 deletion src/storage/backup/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ risingwave_pb = { workspace = true }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "1"
twox-hash = "1"
twox-hash = "2"

[dev-dependencies]
risingwave_hummock_sdk = { workspace = true }
Expand Down
5 changes: 1 addition & 4 deletions src/storage/backup/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ pub mod meta_snapshot_v2;
pub mod storage;

use std::collections::{HashMap, HashSet};
use std::hash::Hasher;

use itertools::Itertools;
use risingwave_common::RW_VERSION;
Expand Down Expand Up @@ -92,9 +91,7 @@ pub struct MetaSnapshotManifest {
}

pub fn xxhash64_checksum(data: &[u8]) -> u64 {
let mut hasher = twox_hash::XxHash64::with_seed(0);
hasher.write(data);
hasher.finish()
twox_hash::XxHash64::oneshot(0, data)
}

pub fn xxhash64_verify(data: &[u8], checksum: u64) -> BackupResult<()> {
Expand Down

0 comments on commit 94ccd00

Please sign in to comment.