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

Alternative Hash (ex : highway, xxh3) #69

Open
chris-ha458 opened this issue Sep 1, 2023 · 1 comment
Open

Alternative Hash (ex : highway, xxh3) #69

chris-ha458 opened this issue Sep 1, 2023 · 1 comment

Comments

@chris-ha458
Copy link

wyrng has been shown to have some flaws within the randomness
(from official repo )

Both of them are not 64 bit collision resistant, but is about 62 bits (flyingmutant/Cyan4973/vigna)
When test on longer dataset (32TB, 23 days), wyrand will fail practrand (vigna)

Would there be interest in implementing an alternative hash?

If there is interest, I think I might take a try in implementing it.
I think possible candidates would be highwayhash or xxh3
The former has a bit stronger preliminary (but not full) cryptanalysis. But both pass smhasher without problems without known hash issues.

Both are known to be fast.
I do want to add that all algorithms, including wyhash, has strong and weak points regarding speed depending on input length, output length, specific implementation (if SIMD which ISA?).
So I think it would not be fair to judge speed without seeing the actual implementation here.

If there is interest I might proceed as follows.
I shall assume that there is a desire here to keep it simple and not add another dependency

  1. abstract current implementation within the codebase and isolate it
  2. implement an alternate hash and then provide a way to select it, or maintain a branch
  3. provide benchmarks to compare the two.
@notgull
Copy link
Member

notgull commented Sep 1, 2023

I will accept a PR to change the RNG algorithm if the benchmarks show that it is faster. However I am against having more than one supported RNG algorithm, as that is out of scope for this crate and would be more in scope for something like rand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants