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

Incorrect state generated by NumpySeedSequence for uint64 #3

Open
nikolaspaci opened this issue Sep 17, 2024 · 1 comment
Open

Incorrect state generated by NumpySeedSequence for uint64 #3

nikolaspaci opened this issue Sep 17, 2024 · 1 comment

Comments

@nikolaspaci
Copy link

Hello,
I think there is an issue in the method generate() of NumpySeedSequence.
The state calculated when the words's size is 64 bits it's not the same as numpy.
So we don't have same results for a same seed.
I think you have to change return (result_type)((uint64_t)state1 << 32 | state2); to return (result_type)(state1 | (uint64_t)state2 << 32) Thanks to this we have same randoms values like numpy.
Thanks for you project :)

@IamSanjid
Copy link
Owner

Hey thanks for the kind words, I think the result might've altered because I was using little endian architecture and you're uing big endian machine, my bad I should've commented those out but anyways can you do further testing, and open a pull request?

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

No branches or pull requests

2 participants