Skip to content

Commit

Permalink
Switch SipHash to XxHash
Browse files Browse the repository at this point in the history
  • Loading branch information
sffc committed Sep 14, 2023
1 parent 44af79f commit b33aed9
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 9 deletions.
18 changes: 18 additions & 0 deletions Cargo.lock

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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions provider/datagen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ serde = { version = "1.0", default-features = false, features = ["derive", "allo
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
serde-aux = { version = "4.1.2", default-features = false }
toml = "0.5"
twox-hash = "1.6"
zip = { version = ">=0.5, <0.7", default-features = false, features = ["deflate"] }

rayon = { version = "1.5", optional = true }
Expand Down
5 changes: 2 additions & 3 deletions provider/datagen/src/transform/cldr/time_zones/names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ impl IterableDataProvider<Bcp47ToIanaMapV1Marker> for crate::DatagenProvider {
}

fn create_hasher() -> impl std::hash::Hasher {
#[allow(deprecated)] // use SipHasher to reduce dependency count; see #4024
std::hash::SipHasher::new()
twox_hash::XxHash64::with_seed(0)
}

fn compute_bcp47_ids_hash(bcp47_ids: &ZeroSlice<TimeZoneBcp47Id>) -> u64 {
Expand All @@ -121,7 +120,7 @@ fn test_compute_bcp47_ids_hash() {

// Checksum 1: the default output of the zeroslice hashing function
let checksum1 = compute_bcp47_ids_hash(&bcp47_ids);
assert_eq!(checksum1, 0x301FDFA03E1A34A4); // stability
assert_eq!(checksum1, 0x66FA043B31200DCB); // stability

// Checksum 2: hashing of each individual element
// (should equal 1)
Expand Down

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

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

4 changes: 2 additions & 2 deletions provider/datagen/tests/data/postcard/fingerprints.csv
Original file line number Diff line number Diff line change
Expand Up @@ -1937,7 +1937,7 @@ segmenter/line@1, und, 18811B, 12f61c35e42a3bc4
segmenter/lstm/wl_auto@1, th, 72034B, c46e2e0c098c1fc1
segmenter/sentence@1, und, 14402B, 379e46c5be8e8e5f
segmenter/word@1, und, 14641B, d91c662e2d94f17f
time_zone/bcp47_to_iana@1, und, 7568B, ca53028c19c920ac
time_zone/bcp47_to_iana@1, und, 7569B, e3ddf20b1d136d6
time_zone/exemplar_cities@1, ar, 10350B, 1c554603fa64a295
time_zone/exemplar_cities@1, ar-EG, 10350B, 1c554603fa64a295
time_zone/exemplar_cities@1, bn, 15146B, fc38df62995b3e8e
Expand Down Expand Up @@ -2010,7 +2010,7 @@ time_zone/generic_short@1, sr-Latn, 61B, da063c8d2cbb7223
time_zone/generic_short@1, th, 21B, 70edef5aa0f7a054
time_zone/generic_short@1, tr, 21B, 70edef5aa0f7a054
time_zone/generic_short@1, und, 21B, 70edef5aa0f7a054
time_zone/iana_to_bcp47@1, und, 9748B, 94d199894e028f36
time_zone/iana_to_bcp47@1, und, 9749B, 2508f8150e633b96
time_zone/metazone_period@1, und, 11270B, f204686d7a3e5ca0
time_zone/specific_long@1, ar, 11362B, a886b0294ef9f145
time_zone/specific_long@1, ar-EG, 11362B, a886b0294ef9f145
Expand Down

0 comments on commit b33aed9

Please sign in to comment.