Use wyrand final v4.2 constants for gen_u64() #82
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BREAKING CHANGE
This PR introduces updates to
fastrand
's Wyrand algorithm, primarily using updated constants from the final v4.2 implementation ofwyhash
. This modification of the constants means the output of the generator is different, hence the breaking change. Based on the C reference, the new constants are generated using the same secrets algorithm but with a modification to ensure the constants are also large prime numbers. This additional property has helped improve the quality of the hashing for wyhash and the referencewyrand
function.Given the wide usage of
fastrand
, improving the quality of the generated output will be a nice plus, especially if it does not involve any performance hits (sincefastrand
is about being fast). But it will necessitate a new major version as anyone relying on deterministic output will have different generated sequences compared to before.Reference:
C reference
wyrand
function