Skip to content

Implemented Into<[u64;2]> for Xorshift128Plus#5

Merged
IvanUkhov merged 1 commit intostainless-steel:mainfrom
JFT70:main
Oct 10, 2025
Merged

Implemented Into<[u64;2]> for Xorshift128Plus#5
IvanUkhov merged 1 commit intostainless-steel:mainfrom
JFT70:main

Conversation

@JFT70
Copy link
Contributor

@JFT70 JFT70 commented Oct 8, 2025

Hi,
Since the internals fields of Xorshift128Plus can not be read and thus restored using a new([u64;2]) I just added support for Serde.

I am working on a seed based procedural generation tool and the ability to store the generator state and reload it is required.

Thank you for your consideration.

@IvanUkhov
Copy link
Member

Hello, thank you for the PR. This crate is meant to be minimalistic. I would not want to add that dependency. However, I would be open to opening the internal state if there is interest. If you are up for this, please go ahead and add Into<[u64; 2]>.

@JFT70
Copy link
Contributor Author

JFT70 commented Oct 9, 2025

Thank your for your response. I am not used to contributing, I amended my commit. I hope this is the "right way" if not let me know!

@JFT70 JFT70 changed the title Added Serde support for Xorshift128Plus Implemented Into<[u64;2]> for Xorshift128Plus Oct 9, 2025
@IvanUkhov IvanUkhov merged commit eeafa4c into stainless-steel:main Oct 10, 2025
2 of 3 checks passed
@IvanUkhov
Copy link
Member

Thank you!

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants