Create our own Random class using the xoshiro256 algorithm#396
Open
initsu wants to merge 11 commits intoEllendar:5.1from
Open
Create our own Random class using the xoshiro256 algorithm#396initsu wants to merge 11 commits intoEllendar:5.1from
initsu wants to merge 11 commits intoEllendar:5.1from
Conversation
Owner
|
Not going to merge this for 5.1 . Probably just adding it wont cause issues but actually using it is not something I want to introduce when i'm trying to finish up and be ready to ship 5.1. Feel free to start up a branch for 5.2 and we can merge it there. |
- This same algorithm can be chosen by .NET internally (and is Public Domain), but there is no guarantee that this is the case. By having a specific implementation, we can guarantee deterministic output. - This gives access to the state of the Random object at any point via GetState and SetState methods that use Base64 strings. This should allow us to capture the RNG state if an error occurs and reproduce it as needed. - This Random class exists in the RandomizerCore package and will take precedence when working inside this package. It is not a subclass of the System.Random class, so trying to use the wrong class somewhere will just not compile. It has no constructor without a seed. When we don't need to specify a seed, we can still use System.Random (as that implies we don't care about deterministic output). Implements Ellendar#395
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I did not find a library that satisfied all requirements, so I just made a variant of existing open source (MIT or Public Domain) code.
Implements #395