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

CityHash updated to v1.1 #287

Merged
merged 2 commits into from
Jun 20, 2024
Merged

CityHash updated to v1.1 #287

merged 2 commits into from
Jun 20, 2024

Conversation

SuperioOne
Copy link
Contributor

This PR updates CityHash to v1.1 commit. The results are looking fairly similar to the older version.

Side notes:

  • CityHash32 doesn't support seed value in v1.1 code. As alternatives, there are versions that support seeds, like modified CityHash v1.1.1 from SMHasher3. However, I stick with Google's original repo and simply removed the bad seed test for CityHash32 (0x2eb38c9f).
  • Added CityCrc256 test. It also doesn't support seed value.

Test results

City32.txt
City64.txt
City64low.txt
City64noSeed.txt
City128.txt
CityCrc128.txt
CityCrc256.txt

Copy link
Owner

@rurban rurban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly good modernizations, but I prefer to keep the seed mixed in and keep the bad seed tests

City.cpp Outdated Show resolved Hide resolved
City.cpp Outdated Show resolved Hide resolved
City.cpp Outdated Show resolved Hide resolved
City.cpp Show resolved Hide resolved
- city32's known bad seed is added back to g_hashes.
@SuperioOne
Copy link
Contributor Author

I pushed the changes for city32.

Also, added back the known bad seed, and BadSeeds test is working as expected.

[[[ BadSeeds Tests ]]]

Testing 1 internal secrets:
0x2eb38c9f 
Broken seed 0x2eb38c9f => 0 with key[16] of all 0 bytes confirmed => hash 0 !!!!

*********FAIL*********

@SuperioOne SuperioOne requested a review from rurban June 20, 2024 16:01
Copy link
Owner

@rurban rurban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect

@rurban rurban merged commit 5efdfb7 into rurban:master Jun 20, 2024
7 of 10 checks passed
@SuperioOne SuperioOne deleted the cityhash_v1_1 branch July 24, 2024 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants